JetBrains / teamcity-docker-agent

TeamCity agent docker image sources
https://hub.docker.com/r/jetbrains/teamcity-agent/
Apache License 2.0
77 stars 64 forks source link

DOCKER_OPTS insecure-registry setting not working #57

Closed overton660 closed 4 years ago

overton660 commented 4 years ago

I am trying to run a docker build in an agent within the container. The docker file of my project pulls from an insecure docker registry. I have tried setting the insecure registry in the docker_opts environment variable, but am still getting the error. Hoping someone can guide me in the right direction

Here is my docker run command. docker run -it -e SERVER_URL="http://buildtest:880" --privileged -e DOCKER_OPTS="--insecure-registry 10.0.4.89:2113" -e DOCKER_IN_DOCKER=start -e AGENT_NAME="Docker-TeamCity" -v :/data/teamcity_agent/conf jetbrains/teamcity-agent

The agent starts and connects to our agent perfectly, but I get the classic insecure registry error 'http response to an https client' I have execed into the machine and dont see a daemon.json file. Not sure if I should just mount the file, or if that would even work. Any help is appreciated.

kir commented 4 years ago

Hi, have you tried setting DOCKER_OPTS environment variable in your build settings, in the Parameters section of the build configuration?

overton660 commented 4 years ago

I have not, I will try that and get back

overton660 commented 4 years ago

I am not sure if I have the correct syntax, but what I have now is not working.

image

Is this how to set the variable properly?

kir commented 4 years ago

Hi, you should add not "Docker Opts" variable in TeamCity UI, but DOCKER_OPTS, so the name would be env.DOCKER_OPTS and the value --incesure-registry...

Hope this helps,

overton660 commented 4 years ago

Gotcha, I will give that a shot just to see if it works, but I did end up resolving the issue by setting up a revers proxy server to handle the https