drone-docker
drone-docker copied to clipboard
Allow configuring image name (`-t`) in initial build command
Currently the initial docker build command passes -t option with commit hash and cannot be configured. If a repo has multiple dockerfiles and the both are built at the same time, it conflicts the tag name and results in error.
That's not true, this plugin is using docker in docker, which isolates the builds.
If you are using the plugin differently it's simply a corner case which is not covered by the intended use case.
Mind showing what's the intended way to use it? I'm current setting
volume:
- /var/run/docker.sock:/var/run/docker.sock
so it shares the docker runtime with the host OS. and I though this was intendend way to use DinD.
That's not dind at all. Just remove the volume, than it will properly build and it's working as intended.
I ran into this problem too - I am mounting the host docker volume because our image is a heavy build and without it, the plugin will not have an image cache and end up building images every single time. Is there a way to configure that?
I stumbled on this too. We have drone pipeline building set of images to ECR repo (using drone-ecr). To test that pipeline locally, I replace the steps with drone-docker and set daemon_off: true, dry_run: true and mount the socket. This works, except the images are build concurrently and all of them use the image name 00000000, which of course is not unique.
Just using the format <repo>:<commit-sha> should be enough to fix the issue.