Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skopeo doesn't seem to use Docker image cache when running in container #1121

Closed
meriouma opened this issue Feb 11, 2022 · 2 comments · Fixed by #1127
Closed

skopeo doesn't seem to use Docker image cache when running in container #1121

meriouma opened this issue Feb 11, 2022 · 2 comments · Fixed by #1127
Assignees
Labels
bug Something went wrong
Milestone

Comments

@meriouma
Copy link

meriouma commented Feb 11, 2022

Describe the bug
While using Tern in a Docker container, skopeo tries to download the image, although it was already pulled by docker. What I'm trying to achieve here is run Tern on a private image on Github Actions. The steps are (I'm using those steps for other tools and it works fine) :

  1. Login to private registry
  2. Pull the private image with docker pull
  3. Run docker run -v /var/run/docker.sock:/var/run/docker.sock philipssoftware/tern:2.9.1 report -f cyclonedxjson -o output.json -i privaterepo/image:tag (as per the README)

Error in terminal
Although the image was succesfully pulled by docker :

2022-02-11 22:17:58,014 - ERROR - skopeo - Error when downloading image: "b'time="2022-02-11T22:17:58Z" level=fatal msg="Error initializing source docker://privaterepo/image:tag: Error reading manifest edge in privaterepo/image:tag: unauthorized: authentication required"\n'"
2022-02-11 22:17:58,015 - CRITICAL - run - Cannot download Container image: "privaterepo/image:tag"

Expected behavior
Tern running on the already pulled image on the host.

Environment you are running Tern on
Enter all that apply

  • Output of 'tern --version' : 2.9.1
@nishakm
Copy link
Contributor

nishakm commented Feb 18, 2022

Also related to #1087 - where skopeo may require either access to registries.conf and/or passing the tls-verify=false flag.

@nishakm
Copy link
Contributor

nishakm commented Feb 18, 2022

@meriouma Have you tried mounting your registries.conf file from your host to the tern container? Similar to this: https://docs.docker.com/registry/configuration/#overriding-the-entire-configuration-file

nishakm pushed a commit to nishakm/tern that referenced this issue Feb 18, 2022
In situations where TLS is not enabled for a registry, users
may now turn off the option to check TLS certificates and use
HTTP rather than HTTPS to pull images using skopeo.

It is advised to not use this flag for untrusted registries and
only use it for registries hosted locally to testing or debugging.

This option is also added for the `debug` sub-command.

Fixes tern-tools#1121 and tern-tools#1087

Signed-off-by: Nisha K <[email protected]>
nishakm pushed a commit to nishakm/tern that referenced this issue Feb 18, 2022
In situations where TLS is not enabled for a registry, users
may now turn off the option to check TLS certificates and use
HTTP rather than HTTPS to pull images using skopeo.

It is advised to not use this flag for untrusted registries and
only use it for registries hosted locally to testing or debugging.

This option is also added for the `debug` sub-command.

Fixes tern-tools#1121 and tern-tools#1087

Signed-off-by: Nisha K <[email protected]>
nishakm pushed a commit to nishakm/tern that referenced this issue Feb 19, 2022
In situations where TLS is not enabled for a registry, users
may now turn off the option to check TLS certificates and use
HTTP rather than HTTPS to pull images using skopeo.

It is advised to not use this flag for untrusted registries and
only use it for registries hosted locally to testing or debugging.

This option is also added for the `debug` sub-command.

Fixes tern-tools#1121 and tern-tools#1087

Signed-off-by: Nisha K <[email protected]>
rnjudge pushed a commit that referenced this issue Feb 23, 2022
In situations where TLS is not enabled for a registry, users
may now turn off the option to check TLS certificates and use
HTTP rather than HTTPS to pull images using skopeo.

It is advised to not use this flag for untrusted registries and
only use it for registries hosted locally to testing or debugging.

This option is also added for the `debug` sub-command.

Fixes #1121 and #1087

Signed-off-by: Nisha K <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something went wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants