Closed baptistemesta closed 8 years ago
I can split the migation to 2.1.1 and the addition of the save command, btw should docker task be splitted in order to split build/push/save/whatever?
no merge since begin of october. is this project dead? i need a newer java client version too for my project.
in order to be able to save images to filesystem (not a commom usecase) I created and published my own gradle plugin with up to date java client here https://github.com/baptistemesta/docker-build if you only need build/push (not the integration to distribution plugin) I can add it there and publish it quickly
We need a way to continue support older versions of Docker, and not only the latest one. So, in order to merge a newer java-client please add some backward compability to support this. Also, I believe migration to java client 2.1 (with older Dokcer version support) should be a separate pull request.
Suggestion: try to perform your pull request upon dev branch where all new development is done, which is quite a lot of rework done in that one.
I updated the java client to version 2.2.0. Thanks for the contribution! I haven't merged the "save image" feature yet. I am considering to break that out into its own Task (e.g. "saveDockerImage"), something I'd want to do with "push" as well. What do you think?
@bjornmagnusson: Concerning backwards compatibility: the new version of the java client requires Docker engine version 1.7 and above. I people need to use this plugin with an older version of the Docker engine I suggest they rely on the native docker client binary. What do you think?
BTW: I merge the dev
branch into master and continue development on master from now on. The dev
branch was just causing confusion and most PRs are build from master
anyway.
@mattgruter I was a bit concerned regarding this at first, however since docker pull/push to Docker Hub is disabled for clients with version 1.5 and below I think this requirement is fine. Only version which is neglected is in this case 1.6, which is a very old version in Docker terms, released almost a year ago. As long as we document this clearly we are fine in my opinion.
I agree upon this removal of dev branch for same reasons, it made merging PRs quite tiresome and difficult, so...yay
Also, a saveDockerImage task seems like a reasonable way to do it
:+1: getting rid of dev
:fist:
Hi! yes the save feature should have been in an other PR anyway An other task should do the trick. Just to have some context because saving an docker image is not really common, my use case was to build a docker image on a CI an deliver it as a binary instead of pushing it to a docker repository.
Since i needed it fast I made my plugin as mentioned before. I don't know if some things can be taken from that but in case here is the link followed by some highlights: https://github.com/baptistemesta/docker-build
The part that were important for me was a minimal configuration of the project using the plugin. Here is a sample configuration:
apply plugin: 'distribution'
apply plugin: 'docker-build'
group = "com.myproject"
version = "1.0.0-SNAPSHOT"
docker {
serverUrl = System.getProperty("docker.url")
saveImageTo = new File(buildDir, "docker-image.tar")
}
distributions {
main {
contents {
from { docker.saveImageTo }
}
}
}
tasks.distZip.dependsOn(tasks.buildDockerImage)
and to build the image you just have to run on the project
locally gradle distZip
or with a remote docker gradle distZip -Ddocker.url=DOCKER_URL
I don't know if something like this can be also done in this plugin since it was more oriented on creating a docker image to run
I like that. I don't know how common saving an image to a tarball is but I can definitely see it being used. In my opinion we should add it but probably not in the upcoming 1.3
release (I'm trying to push it out the door soonish so adding new features is not my top prio right now :-)
@baptistemesta would you mind opening an issue about that? Like that we could track it more easily. You could just link to this discussion for context.
will do, tanks
Needed save command to be available in my build so i updated to docker-java 2.1.1 and added the new save command