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

Tern Docker image: Pulling images from private registry #1160

Closed
software-testing-professional opened this issue Apr 21, 2022 · 5 comments
Closed

Comments

@software-testing-professional
Copy link

software-testing-professional commented Apr 21, 2022

Is it possible to pull and analyze images from a private registry (like Artifactory)?

This happens when the Tern container is used in Gitlab CI. Although a docker login ... has been executed, and the /.docker/config has been mounted into the Tern container.

It works fine on my local machine.

It results in 2022-04-21 09:04:17,531 - WARNING - docker_api - Build failed: Get https://***********.com/v2/its-javabase/manifests/java-11: unknown: Authentication is required

I'm running Tern like this:

docker run \
  --privileged \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v "$PWD/tmp/${PROJECT_NAME}:/project" \
  -v "$PWD/docker/config.json:/root/.docker/config.json" \
  -v "$PWD/docker/config.json:/root/.docker/config" \
  **************.com/ternd \
  --driver fuse \
  report \
    -d /project/Dockerfile \
    -f cyclonedxjson \
    -o /project/container.bom.json

Thanks for your help!

@rnjudge
Copy link
Contributor

rnjudge commented Apr 27, 2022

Hello! The issue of private repositories can be solved by either changing the Dockerfile or to mount the registries file to the build tern image. However, this doesn't work for situations where you want to run a demo registry without https or TLS verification. For this purpose, you would need to send the tls-verify=false flag to skopeo to pull the image.

See #1087 (comment) for more info about how to add your private registry to the base tern image. Here's another suggestion from a similar question: #1121 (comment).

@rnjudge
Copy link
Contributor

rnjudge commented Jun 27, 2022

Hi @software-testing-professional -- did you get a resolution to your issue or can I close this?

@software-testing-professional
Copy link
Author

@software-testing-professional
Copy link
Author

Hi @rnjudge,

yes it works now.

It turned out that the config.json was incomplete.
I added some more authentication data to the .docker/config.json.
Now it is possible to pull Artifactory images via skopeo.

Thanks for your help!

Best regards,
Michael

@rnjudge
Copy link
Contributor

rnjudge commented Jun 29, 2022

@software-testing-professional very happy to hear this! Thanks for your followup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants