buildkite-plugins / docker-buildkite-plugin

🐳📦 Run any build step in a Docker container
MIT License
113 stars 106 forks source link

Document mounting docker repo credentials #121

Closed rcoup closed 5 years ago

rcoup commented 5 years ago

Otherwise if you want to push/pull images from remote docker repositories from within your step container it won't work.

For the Elastic Stack, the credentials on the host live at /var/lib/buildkite-agent/.docker/config.json

toolmantim commented 5 years ago

Thanks for taking the time to submit a PR.

Docker Credentials are stored in all sorts of ways these days, e.g. https://github.com/buildkite-plugins/docker-login-buildkite-plugin/pull/31, so I'm not sure if we can provide a good generic piece of advice/documentation on this sorry!

lox commented 5 years ago

That was at my suggestion based on the current Elastic Stack @toolmantim, but I hear ya. Thanks @rcoup, we'll discuss.

rcoup commented 5 years ago

@toolmantim so what's the approach with DOCKER_CONFIG ala the linked ticket? Is it as easy as:

volumes:
  - ${DOCKER_CONFIG}:/root/.docker/config.json

? or $$?

If that doesn't work could it the path(s) be changed to use a variable we do have access to (ie. not the PID)?

toolmantim commented 5 years ago

@rcoup sorry for the delayed reply! I don't think it'd be possible to use this plugin with DOCKER_CONFIG — neither ${DOCKER_CONFIG} or $${DOCKER_CONFIG} would work correctly in the plugin config. We'd need to add an explicit parameter to mount it through for you perhaps?

I think we should close this PR for now @lox?

rcoup commented 5 years ago

I'll close it, but it'd be nice to get some way to support people trying to make it work.