docker-buildkite-plugin icon indicating copy to clipboard operation
docker-buildkite-plugin copied to clipboard

Can't interpolate ENV vars in mount path

Open mvastola opened this issue 4 years ago • 1 comments

Note: This seems related to #185, but the workaround suggested does not apply for my use case.

I just submitted buildkite-plugins/ecr-buildkite-plugin#72, but I'm not sure where the issue lies.

TL;DR: I'm trying to mount my ${DOCKER_CONFIG} folder into a docker container, but it appears the ecr plugin isn't setting it in such a way that I can't simply put ${DOCKER_CONFIG}:/home/user/.docker in the volumes array.

Per the docs, however, it seems I should be able to add an extra dollar sign (so, $${DOCKER_CONFIG}:/home/user/.docker) and make it work. However, for whatever reason, although $${DOCKER_CONFIG} is converted to ${DOCKER_CONFIG}, it isn't expanded beyond that, and the literal string ${DOCKER_CONFIG} is sent to docker as an argument.

Would it be possible to turn on interpolation for the volume paths so that this works?

mvastola avatar Sep 23 '21 02:09 mvastola

I am having the same issue.

dubhunter avatar Jul 19 '22 21:07 dubhunter

I would be interested in understand what is the use-case for sharing the actual DOCKER_CONFIG path as a mount to the container.

From what I've understood reading the description, linked issue and links in there as well, the only variables that would pose an issue are those that change from job execution to job execution (all the others can probably be worked-around through differing the pipeline upload to when the variable do exist). Or am I missing something?

toote avatar Sep 20 '22 17:09 toote

@toote It allows you to provide credentials (this file is where they're stored for ECR by the aws CLI) and similar info (if a host uses a credential provider) to the container so it can do pushes/pulls.

mvastola avatar Sep 29 '22 05:09 mvastola