-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support building and publishing Docker images. #277
Conversation
LGTM.The main logic is just: val cmd = Seq("docker", "build", "-t", tag, ".")
val ret = Process(cmd, cwd) ! processLogger
// and
val cmd = Seq("docker", "push", tag)
val ret = Process(cmd, cwd) ! processLogger Maybe you could refactor the processLoggers into some private methods. The main logic |
Damn yes :) We released a v0.7.2-RC2 last week. If things go fine, I would like to add this feature as experimental in the So, if you could write this documentation, it would be awesome (new pull request). If you don't have enough time, then just ping me here and I try to. |
This provides reasonable behaviour for Docker publish/publishLocal tasks. docker:publishLocal maps to "docker build -t [dockerTarget] ." docker:publish maps to "docker push -t [dockerTarget]" docker:dockerTarget has a default value of [dockerRepository]/[normalizedName]:[version]
I've rebased and squashed this commit. Note that if you don't want to merge this yet, then the current documentation is incorrect; I can submit another pull request to fix that (and add the documentation here instead). |
Ah, this pr got out my focus, sorry :( Is there a way to test the Which part of the documentation is wrong? If we merge this pr the documentation I retriggered the travis ci build as there seem to be some sbt initialization issues. |
I added a small test for an image that prints "Hello world". But: Supporting Docker with Travis is going to be tough. It looks like TravisCI currently have no plans to support Docker inside their containers. There seem to be some attempts by people to run docker servers, e.g. https://github.com/lukecyca/travis-docker-example/blob/master/.travis.yml - but it doesn't look like something to rely on. |
Hm, hopefully travis will provide something in the future. That would be awesome. |
$ docker -v Using https://github.com/boot2docker/boot2docker for OSX |
I'm currently running all the tests. When everything is fine I'll merge this one :) |
Support building and publishing Docker images.
This provides reasonable behaviour for Docker publish/publishLocal tasks.
docker:publishLocal
maps todocker build -t [dockerTarget] .
docker:publish
maps todocker push -t [dockerTarget]
docker:dockerTarget
has a default value of[dockerRepository]/[normalizedName]:[version]
I have other code that creates a new Ivy repository type, but this way was simpler. Also, there was no access to the SBT logging context in Ivy's API, making reasonable support for logging/errors more difficult.
Note:
dockerBaseImage, dockerRepository are defined outside the Docker config, making them easier to set for a user, but they have reasonable defaults.