Hey everyone! I have a Docker image that runs a binary to pull images from a remote repository for scanning purposes, but it needs credentials to do so. I'm looking for effective ways to pass those credentials into the Docker image so the binary can pull the necessary images. Any suggestions? Thanks!
1 Answer
You can check out the Docker documentation on secrets. It has instructions about building support for Docker secrets into your images, which is a solid way to handle credentials safely without hardcoding them. Here’s a link: https://docs.docker.com/engine/swarm/secrets/#build-support-for-docker-secrets-into-your-images
Thanks for the suggestion! I attempted a similar method by running the command `docker run -v ~/.docker/config.json:/root/.docker/config.json image-name --option` but it didn’t work for me. Am I doing something wrong? The container I’m using needs to pull images from a remote URL via crane.