-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Proposal: Build to Docker Daemon #223
Conversation
proposals/docker_build.md
Outdated
|
||
## Intended Workflow | ||
|
||
Building to a Docker daemon should be as simple as calling the build task/goal (`jib:build` for Maven and `jib` for Gradle) with an additional parameter called `buildToDockerDaemon` enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should just add a new task? I'm definitely not suggesting we do this, just wondering if we should or should not.
jib:buildToDockerDaemon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and if we do this, perhaps we can match the bazel dockerless builds and also produce an intermediate tar, which may or may not help us with simple skaffold integration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, a new task does sound good so that we wouldn't need any extra configuration to clutter the default build+push workflow. And yeah, exporting the intermediate tar sounds good. Maybe we can instead do:
jib:tar
to build the tar
jib:load
to load the tar into the Docker daemon
This way, we could implement jib:tar
first to enable integration with Skaffold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided on jib:buildDocker
After looking into both https://github.com/docker-java/docker-java and https://github.com/spotify/docker-client, it looks like https://github.com/docker-java/docker-java is what we want since it uses the same (AFAICT) default Docker daemon as the docker CLI with |
The non-process option would be kind of nice, but it might be worth it to be careful pulling in a complex dependency like docker-java, it itself has a large number of dependencies and we might not want to complicate a user's build dependencies for a single docker operation. |
Updated to use the |
proposals/docker_build.md
Outdated
## Constraints | ||
|
||
* Building to local Docker daemon should be an extra feature, not the default | ||
* Should not depend on a Docker CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess were doing this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
1. Find the Docker daemon. | ||
- This should use the same Docker daemon that the `docker` CLI would. | ||
- The default host is `unix:///var/run/docker.sock` or `tcp://127.0.0.1:2375`. | ||
- Remote Docker daemon can be configured with environment variables, such as those output by `minikube docker-env`. These include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we have to allow the user to configure this on our process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it would just use the environment variables Jib was run in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I forgot about that.
For issue #48 .
For preview, see https://github.com/google/jib/blob/proposal-dockerbuild/proposals/docker_build.md