Skip to content

Use DOCKER_ env vars to locate the Docker daemon when building OCI images #20538

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

Closed
saturnism opened this issue Mar 17, 2020 · 0 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@saturnism
Copy link

I'm running Docker from minikube (and also tried a remote docker machine).

The docker daemon endpoint and cert are configured via env vars:

DOCKER_BUILDKIT=1
DOCKER_CERT_PATH=/Users/rayt/.minikube/certs
DOCKER_HOST=tcp://192.168.64.2:2376
DOCKER_TLS_VERIFY=1

When I run ./mvnw spring-boot:build-image, the container build failed:

...
[INFO] --- spring-boot-maven-plugin:2.3.0.M3:build-image (default-cli) @ demo ---
[INFO] Building image 'docker.io/library/jib-demo:latest'
[INFO]
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [61] Connection refused
[INFO] Retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [61] Connection refused
[INFO] Retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [61] Connection refused
[INFO] Retrying request to {}->docker://localhost:2376
[INFO]  > Pulling builder image 'docker.io/cloudfoundry/cnb:0.0.53-bionic' 100%
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.013 s
[INFO] Finished at: 2020-03-16T22:53:23-04:00

The plugin assumes the docker daemon is running on localhost:2376, when it the env var DOCKER_HOST is pointing else where tcp://192.168.64.2:2376

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 17, 2020
@wilkinsona wilkinsona changed the title spring-boot:build-image doesn't refer to docker env var Use DOCKER_ env vars to locate the Docker daemon when building OCI images Mar 17, 2020
@wilkinsona wilkinsona changed the title Use DOCKER_ env vars to locate the Docker daemon when building OCI images Use DOCKER_ env vars to locate the Docker daemon when building OCI images Mar 17, 2020
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 17, 2020
@wilkinsona wilkinsona added this to the 2.3.x milestone Mar 17, 2020
@scottfrederick scottfrederick self-assigned this Mar 20, 2020
@scottfrederick scottfrederick modified the milestones: 2.3.x, 2.3.0.M4 Mar 30, 2020
scottfrederick added a commit that referenced this issue Mar 31, 2020
This commit adds documentation for the configuration required to
use a remote Docker daemon with the `build-image` Maven goal or the
`bootBuildImage` Gradle task.

See gh-20538
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants