Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Add --build-arg support #91

Open ShadowCoder22 opened 8 years ago

ShadowCoder22 commented 8 years ago

Docker allows users to pass arguments to the build command. This is useful for cases where a developer has to calculate a variable at build time. Please consider adding support for this feature.

bjornmagnusson commented 7 years ago

As I see it, only reason for using this property would be when using an static/external Dockerfile. When plugin is generating the Dockerfile you already can provide properties from within you build script

bjornmagnusson commented 7 years ago

Unsupported in docker-java 2.2.0 (used by plugin in master). Needs docker-java 3.0.0+, which includes breaking changes. Postpone this to an later release.

gclayburg commented 7 years ago

It would be nice to have this so that you could add build time arguments to a Dockerfile LABEL like this

docker build --build-arg VCS_REF=`git rev-parse --short HEAD` .
chadlwilson commented 7 years ago

Yes; or to pass parameters to other Dockerfile elements that the plugin doesn't have support for; such as HEALTHCHECK

mklueh commented 6 years ago

News on this? Need to disable the cache

bjornmagnusson commented 6 years ago

No work has been done. It is indeed a wanted feature We do welcome PRs.

jainarpit6 commented 6 years ago

Any progress on this ?