Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BUILD_TAGS_DARWIN_CROSS = containers_image_openpgp
SEQUOIA_SONAME_DIR =

BUILDTAGS =
BUILDFLAGS := -tags "$(BUILDTAGS)" -ldflags '-X github.com/containers/image/v5/signature/internal/sequoia.sequoiaLibraryDir='"$(SEQUOIA_SONAME_DIR)"
BUILDFLAGS := -tags "$(BUILDTAGS)" -ldflags '-X go.podman.io/image/v5/signature/internal/sequoia.sequoiaLibraryDir='"$(SEQUOIA_SONAME_DIR)"

# Extra flags passed to go test
TESTFLAGS :=
Expand Down Expand Up @@ -109,7 +109,7 @@ lint:
.PHONY: .gitvalidation
.gitvalidation:
@which $(GOBIN)/git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make clean && make tools'" && false)
git fetch -q "https://github.com/containers/image.git" "refs/heads/main"
git fetch -q "https://github.com/containers/container-libs.git" "refs/heads/main"
upstream="$$(git rev-parse --verify FETCH_HEAD)" ; \
$(GOBIN)/git-validation -q -run DCO,short-subject,dangling-whitespace -range $$upstream..HEAD

Expand Down
11 changes: 3 additions & 8 deletions image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ If you want to see what the library can do, or an example of how it is called,
consider starting with the [skopeo](https://github.com/containers/skopeo) tool
instead.

To integrate this library into your project, include it as a [Go module],
put it into `$GOPATH` or use your preferred vendoring tool to include a copy
in your project. Ensure that the dependencies documented [in go.mod][go.mod]
are also available (using those exact versions or different versions of
your choosing).
To integrate this library into your project, include it as a [Go module].

This library also depends on some C libraries. Either install them:
```sh
Expand All @@ -53,15 +49,14 @@ macOS$ brew install gpgme
or use the build tags described below to avoid the dependencies (e.g. using `go build -tags …`)

[Go module]: https://github.com/golang/go/wiki/Modules
[go.mod]: https://github.com/containers/image/blob/master/go.mod

### Supported build tags

- `containers_image_docker_daemon_stub`: Don’t import the `docker-daemon:` transport in `github.com/containers/image/transports/alltransports`, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.
- `containers_image_docker_daemon_stub`: Don’t import the `docker-daemon:` transport in `go.podman.io/image/v5/transports/alltransports`, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.
- `containers_image_openpgp`: Use a Golang-only OpenPGP implementation for signature verification instead of the default cgo/gpgme-based implementation;
the primary downside is that creating new signatures with the Golang-only implementation is not supported.
- `containers_image_sequoia`: Use Sequoia-PGP for signature verification instead of the default cgo/gpgme-based or the Golang-only OpenPGP implementations, and enable the `signature/simplesequoia` subpackage. This requires a support shared library installed on the system. Install https://github.com/ueno/podman-sequoia , and potentially update build configuration to point at it (compare `SEQUOIA_SONAME_DIR` in `Makefile`).
- `containers_image_storage_stub`: Don’t import the `containers-storage:` transport in `github.com/containers/image/transports/alltransports`, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.
- `containers_image_storage_stub`: Don’t import the `containers-storage:` transport in `go.podman.io/image/v5/transports/alltransports`, to decrease the amount of required dependencies. Use a stub which reports that the transport is not supported instead.

## [Contributing](CONTRIBUTING.md)

Expand Down
2 changes: 1 addition & 1 deletion image/docker/registries_d.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

// systemRegistriesDirPath is the path to registries.d, used for locating lookaside Docker signature storage.
// You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/docker.systemRegistriesDirPath=$your_path'
// -ldflags '-X go.podman.io/image/v5/docker.systemRegistriesDirPath=$your_path'
var systemRegistriesDirPath = builtinRegistriesDirPath

// builtinRegistriesDirPath is the path to registries.d.
Expand Down
2 changes: 1 addition & 1 deletion image/docker/tarfile/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Package tarfile is an internal implementation detail of some transports.
// Do not use outside of the github.com/containers/image repo!
// Do not use outside of the go.podman.io/image repo!
package tarfile
2 changes: 1 addition & 1 deletion image/docs/atomic-signature-embedded-json.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "JSON embedded in an atomic container signature",
"description": "This schema is a supplement to atomic-signature.md in this directory.\n\nConsumers of the JSON MUST use the processing rules documented in atomic-signature.md, especially the requirements for the 'critical' subobject.\n\nWhenever this schema and atomic-signature.md, or the github.com/containers/image/signature implementation, differ,\nit is the atomic-signature.md document, or the github.com/containers/image/signature implementation, which governs.\n\nUsers are STRONGLY RECOMMENDED to use the github.com/containers/image/signature implementation instead of writing\ntheir own, ESPECIALLY when consuming signatures, so that the policy.json format can be shared by all image consumers.\n",
"description": "This schema is a supplement to atomic-signature.md in this directory.\n\nConsumers of the JSON MUST use the processing rules documented in atomic-signature.md, especially the requirements for the 'critical' subobject.\n\nWhenever this schema and atomic-signature.md, or the go.podman.io/image/v5/signature implementation, differ,\nit is the atomic-signature.md document, or the go.podman.io/image/v5/signature implementation, which governs.\n\nUsers are STRONGLY RECOMMENDED to use the go.podman.io/image/v5/signature implementation instead of writing\ntheir own, ESPECIALLY when consuming signatures, so that the policy.json format can be shared by all image consumers.\n",
"type": "object",
"required": [
"critical",
Expand Down
6 changes: 3 additions & 3 deletions image/docs/containers-signature.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ container-signature - Container signature format

# DESCRIPTION
This document describes the format of container signatures,
as implemented by the `github.com/containers/image/signature` package.
as implemented by the `go.podman.io/image/v5/signature` package.

Most users should be able to consume these signatures by using the `github.com/containers/image/signature` package
Most users should be able to consume these signatures by using the `go.podman.io/image/v5/signature` package
(preferably through the higher-level `signature.PolicyContext` interface)
without having to care about the details of the format described below.
This documentation exists primarily for maintainers of the package
Expand Down Expand Up @@ -65,7 +65,7 @@ or in any way usable for making policy decisions about the image.)

When verifying a cryptographic signature in the OpenPGP format,
the consumer MUST verify at least the following aspects of the signature
(like the `github.com/containers/image/signature` package does):
(like the `go.podman.io/image/v5/signature` package does):

- The blob MUST be a “Signed Message” as defined RFC 4880 section 11.3.
(e.g. it MUST NOT be an unsigned “Literal Message”,
Expand Down
2 changes: 1 addition & 1 deletion image/docs/signature-protocols.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Signature access protocols

The `github.com/containers/image` library supports signatures implemented as blobs “attached to” an image.
The `go.podman.io/image/v5` library supports signatures implemented as blobs “attached to” an image.
Some image transports (local storage formats and remote protocols) implement these signatures natively
or trivially; for others, the protocol extensions described below are necessary.

Expand Down
2 changes: 1 addition & 1 deletion image/hack/get_ci_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [[ "$1" == "--config" ]]; then
in_get_ci_vm "$1"
cat <<EOF
DESTDIR="/var/tmp/go/src/github.com/containers/image"
UPSTREAM_REPO="https://github.com/containers/image.git"
UPSTREAM_REPO="https://github.com/containers/container-libs.git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is most likely not enough but I guess it won't do any harm either so that is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, https://github.com/containers/automation_images/blob/a0b436c1239299ebecc4fad849ec3961f305ff98/get_ci_vm/README.md suggests this requires a specific repo layout, where moving everything inside image/ doesn’t transparently work.

(I don’t think I have ever run this script…)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this regularly (on podman that is) but yeah once all the other CI stuff is done I can look at this, it is an optional thing so not really a priority

CI_ENVFILE="/etc/ci_environment"
GCLOUD_PROJECT="skopeo"
GCLOUD_IMGPROJECT="libpod-218412"
Expand Down
2 changes: 1 addition & 1 deletion image/internal/tmpdir/tmpdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// unixTempDirForBigFiles is the directory path to store big files on non Windows systems.
// You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/internal/tmpdir.unixTempDirForBigFiles=$your_path'
// -ldflags '-X go.podman.io/image/v5/internal/tmpdir.unixTempDirForBigFiles=$your_path'
var unixTempDirForBigFiles = builtinUnixTempDirForBigFiles

// builtinUnixTempDirForBigFiles is the directory path to store big files.
Expand Down
4 changes: 2 additions & 2 deletions image/pkg/sysregistriesv2/system_registries_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
// systemRegistriesConfPath is the path to the system-wide registry
// configuration file and is used to add/subtract potential registries for
// obtaining images. You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/sysregistries.systemRegistriesConfPath=$your_path'
// -ldflags '-X go.podman.io/image/v5/sysregistries.systemRegistriesConfPath=$your_path'
var systemRegistriesConfPath = builtinRegistriesConfPath

// systemRegistriesConfDirPath is the path to the system-wide registry
// configuration directory and is used to add/subtract potential registries for
// obtaining images. You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/sysregistries.systemRegistriesConfDirectoryPath=$your_path'
// -ldflags '-X go.podman.io/image/v5/sysregistries.systemRegistriesConfDirectoryPath=$your_path'
var systemRegistriesConfDirPath = builtinRegistriesConfDirPath

// AuthenticationFileHelper is a special key for credential helpers indicating
Expand Down
2 changes: 1 addition & 1 deletion image/signature/internal/sequoia/sequoia.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// sequoiaLibraryDir is the path to the directory where libpodman_sequoia is installed,
// if it is not in the platform’s default library path.
// You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/signature/sequoia.sequoiaLibraryDir=$your_path'
// -ldflags '-X go.podman.io/image/v5/signature/sequoia.sequoiaLibraryDir=$your_path'
var sequoiaLibraryDir = ""

type SigningMechanism struct {
Expand Down
4 changes: 2 additions & 2 deletions image/signature/mechanism_openpgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ func (m *openpgpSigningMechanism) importKeysFromBytes(blob []byte) ([]string, er

// SupportsSigning returns nil if the mechanism supports signing, or a SigningNotSupportedError.
func (m *openpgpSigningMechanism) SupportsSigning() error {
return SigningNotSupportedError("signing is not supported in github.com/containers/image built with the containers_image_openpgp build tag")
return SigningNotSupportedError("signing is not supported in go.podman.io/image built with the containers_image_openpgp build tag")
}

// Sign creates a (non-detached) signature of input using keyIdentity.
// Fails with a SigningNotSupportedError if the mechanism does not support signing.
func (m *openpgpSigningMechanism) SignWithPassphrase(input []byte, keyIdentity string, passphrase string) ([]byte, error) {
return nil, SigningNotSupportedError("signing is not supported in github.com/containers/image built with the containers_image_openpgp build tag")
return nil, SigningNotSupportedError("signing is not supported in go.podman.io/image built with the containers_image_openpgp build tag")
}

// Sign creates a (non-detached) signature of input using keyIdentity.
Expand Down
2 changes: 1 addition & 1 deletion image/signature/policy_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

// systemDefaultPolicyPath is the policy path used for DefaultPolicy().
// You can override this at build time with
// -ldflags '-X github.com/containers/image/v5/signature.systemDefaultPolicyPath=$your_path'
// -ldflags '-X go.podman.io/image/v5/signature.systemDefaultPolicyPath=$your_path'
var systemDefaultPolicyPath = builtinDefaultPolicyPath

// userPolicyFile is the path to the per user policy path.
Expand Down
Loading