Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Aug 16 09:55
    missingfaktor commented #65
  • Jun 24 08:47
    rud commented #132
  • Jun 24 08:46
    rud commented #150
  • May 16 07:08
    Lacritz commented #153
  • May 15 09:39
    Lacritz commented #145
  • May 08 10:37
    Simon3 commented #121
  • Mar 06 01:03
    falmiski-cr commented #153
  • Feb 28 17:12
    RAYs3T commented #153
  • Feb 27 08:22
    wavermartijn commented #153
  • Feb 27 07:29
    alexandrumm commented #153
  • Feb 25 23:08
    dcroley commented #153
  • Feb 19 16:32
    ergunp commented #153
  • Feb 08 16:02
    jakobnordztrom opened #153
  • Jan 28 10:29
    codecov-io commented #152
  • Jan 28 10:26
    jakobnordztrom opened #152
  • Jan 27 20:11

    bjornmagnusson on jdks


  • Jan 27 20:05

    bjornmagnusson on jdks

    Travis: added JDK8 and JDK11 (compare)

  • Jan 27 20:01
    bjornmagnusson closed #148
  • Jan 27 20:01
    bjornmagnusson commented #148
  • Jan 27 19:59
    bjornmagnusson commented #149
Matthias Grüter
we recently started using spring-boot at work here so we'll be adding some more convenience into the plugin one way or the other. can't tell you when though... :-)
Dave Syer
Matthias Grüter
in that case the route via the automatic distDocker is definately the most straight-forward and convenient. but then you won't reuse the Dockerfile from the maven example...
Greg Turnquist
Good morning. Glad to see this being polished up by people more gradle savy than me. I'll test the mods on my Mac when I get home.
Matthias Grüter

hint: if you add


to your Dockerfile you can start containers with the -P/--publish-all flag.

Dave Syer
I know. But I don't know enough to know why it matters yet. It gets published to a random port.
I think for this tutorial it's not necessary anyway
Matthias Grüter
for one it tells the user that the contained app uses port 8080 and for the other the Docker engine has some reflection possibilties where you can basically ask the engine how container ports are mapped during runtime.
e.g. useful for container linking
In general it is considered a good practice to use EXPOSE whenever possible.
Dave Syer
OK. Thanks. I use it in other containers.
This one is just so basic it didn't necessarily warrant it. But I think you are right: it's at least a courtesy to the user (assuming he has access to the Dockerfile - which I would think would be more customary than it seems to be in the Docker community).
Martin Chalupa
Hi guys, I would like to about usage of your plugin on Mac. I've found that it is necessary to setup ip form my boot2docker VM as an API URL. You use docker-java library and I went through their code and it seems that it can use env variables (DOCKER_HOST, DOCKER_CERT and DOCKER_TSL_VERIFY) if you don't specify otherwise. Can I use this in current 1.2 version and I just missed that or do you plan it to another release? I would like to avoid putting ip to gradle files.
Greg Turnquist
Regarding the export variables, I include specific steps to ensure that is setup on your mac to support the docker command. Is that addressing your question?
A thread on SO directed me to put this into .bash_profile => $(boot2docker shellinit 2> /dev/null)
That way, the exports are configured every time you open a new shell.
Martin Chalupa
I wasn't sure if your and docker-java integration supports env variable usage. But it does. I execute gradle distDocker from IntelliJ and it doesn't have variable properly setup. Thanks for pointing me in correct direction.
Greg Turnquist
I can verify the update to our guide also works on my mac. Albeit, it is configured to push to a group I have no access to, and which no reader will have access to. So I'm leary about having a failing step in our guide.
Dave Syer
We can take that discussion elsewhere
its nothing to do with the gradle tooling
Bruno René Santos
Hello all. Is there any way to include the param insecure-registry when pushing to a private registry?
Niklas Carlsson
insecure-registry has to be set as a startup parameter to the docker daemon, so there's not much the plugin can do about that at the moment. I think there are still some open issues about being able to do it ad-hoc on push and pull commands too
Hi all. Is it in plan to have a functionality which can run/stop the image created by the plugin?
Hi all. Will the docker-java-client be updated soon? I need a newer version as my docker host wont accept versions below 1.12.
Stanislav Ivanov
Hello, guys. I didn't find in docs if the plugin is able to connect docker over tls (port 2376) rather than plain http (port 2375). Is it possible?
Zachary Rote
Hey guys. Any of you have an example of using the addFile task within distDocker? I'm attempting to package override application properties into my generated tar file.
Stefán Freyr Stefánsson
Hi there. I'm working on creating some docker containers in our build scripts using Transmode's gradle-docker plugin. I'm wondering what the correct way is for my scenario which is that in each "build cycle" we create multiple containers, one "tools" container and then multiple containers that extend the tools container and only differ by which ports they expose and what entrypoint is used. So I would like to create the tools container in one task and then create all the other derived containers in other tasks but I'm not sure how I can do this without having the "tools container task" publish our tools container to a docker hub and have the other tasks pull that container. I hope I'm making myself at least vaguely clear here... does anybody have a solution to this?
Hi all! Is it possible to run build script using /bin/sh?
Hi..How to push image to a private repository. The Repository needs to be specified as registry="example.com". How to mention the username and password ?
Hi all. Is gradle-docker plugin will be able to work with Docker Remote API when the version of the docker is 1.12+ ?
Jakub Jabłoński
Is there any chance that this plugin will be published in gradle plugins repo ?
Hi All
Is there a channel to ask Gradle questions?
Hi, when I've got my dockerfile build and want to publish, how is this done? I can't seem to figure out how the "docker tag image username/repository:tag" and "docker push username/repository:tag" is done in this plugin
Dave Syer
I think you get a tag by default (based on the groupId and jar name). It's easy to check.
Then you can just docker push (you don't need gradle for that)
yes I've applied the group, applicationName and tagVersion. But how do i access my tag variable, $tag ?
(and yes i want to keep using gradle for pushing)
Dave Syer
I don't think you can (use gradle with this plugin to push)
I never did anyway. If they added that feature I missed it.
I don't understand the question about $tag.
Ok, well I'll find another way then, thank you :)

@dsyer looking at the source tells me otherwise tho: https://github.com/Transmode/gradle-docker/blob/master/src/main/groovy/se/transmode/gradle/plugins/docker/DockerTask.groovy

on the very last lines you have a check for if push == True, which will involke the push. I will just try that and return if it works

Dave Syer
Sounds good. Maybe you could fix the README if you find that it works.
@dsyer It works: make a task with type: Docker, set applicationName and tag, set push=true <-- job done.. This really needs to be documented better :)! I'm no developer, is it open for anyone to fix this ?
oh i can just make a pullrequest for better documenting
Dave Syer
You can.
Justin Fleck
greetings! I commented on Transmode/gradle-docker#122 but will try to tackle to problem
Hi there! Is there a way to set environment variable for the docker image produces by distDocker task?