skopeo 1.3.0 on Alpine 3.14 broken due to missing policy.json
See prior discussion on https://github.com/containers/skopeo/issues/1315.
The following command:
skopeo copy --src-creds=<creds> --dest-creds=<creds> "docker://<path_to_src_image>" "docker://<path_to_dest_image>"
Produces the following error:
Error loading trust policy: open /etc/containers/policy.json: no such file or directory
The error occurred when running skopeo in a Gitlab CI job using the alpine:latest
Docker image. It is unlikely that the exact skopeo
command is the issue here. Quoting the author of skopeo
:
At a first glance, this looks like an Alpine packaging problem:
make install DESTDIR=$(pwd)/p
does create ap/etc/containers/policy.json
.Looking at the package and https://pkgs.alpinelinux.org/package/edge/community/x86_64/skopeo or https://pkgs.alpinelinux.org/package/edge/community/x86_64/containers-common, it seems that the
policy.json
file is nowadays(?) shipped in acontainers-common
package; as for whether it should, or does, get installed automatically, that’s probably best discussed with the Alpine packagers.