Insecure registries and CircleCI

Hello!

“Out of Curiosity” question here… Does CircleCI “support” insecure registries?

We are using CircleCI to build and push docker images to our repositories. While testing the build, I could not push to my insecure registry.

I did not want to build references to insecure registries directly into my docker build images for obvious reasons, and could not get environment variables working within the container.

How have you tried to set up environment variables? I assume this is for the purposes of storing a docker login password?

I got this to work the other day. Just go to https://circleci.com/bb/[user]/[project]/edit#env-vars and then add in a variable/value (e.g. I use CODEFRESH_REGISTRY_TOKEN).

Then you can do this in your config.yml:

docker login -u [username] -p ${CODEFRESH_REGISTRY_TOKEN} [registry-url]

(with appropriate values swapped, of course).

Thanks for the suggestion! It wasn’t anything so much to do with the password, I was being lazy when setting up a test repo, and spent more time trying to run the docker daemon with --insecure-registry in my image than just setting the test registry up with certificates.

I’ll try again with docker login. Thanks :slight_smile:

1 Like