Comments (8)
@davidmichaelkarr : You should be able to see fully qualified image name when you do a docker:build
, this is logged when in normal build without verbose options enabled:
mvn docker:build
docker:0.45-SNAPSHOT:build (default-cli) @ dmp-build-arg-regression ---
[INFO] Building tar: /home/rokumar/work/repos/dmp-testing/dmp-build-arg-regression/target/docker/myimage/21/tmp/docker-build.tar
[INFO] DOCKER> [myimage:21]: Created docker-build.tar in 33 milliseconds
[INFO] DOCKER> [myimage:21]: Built image sha256:07911
[INFO] ------------------------------------------------------------------------
In above case image name is myimage:21
where tag is 21
.
If you specify build
in verbose
option, you will be able to see docker build output:
$ mvn docker:build -Ddocker.verbose=build
[INFO] --- docker:0.45-SNAPSHOT:build (default-cli) @ dmp-build-arg-regression ---
[INFO] Building tar: /home/rokumar/work/repos/dmp-testing/dmp-build-arg-regression/target/docker/myimage/21/tmp/docker-build.tar
[INFO] DOCKER> [myimage:21]: Created docker-build.tar in 33 milliseconds
[INFO] DOCKER> Step 1/2 : ARG FROM_IMAGE
[INFO] DOCKER>
[INFO] DOCKER> Step 2/2 : FROM ${FROM_IMAGE} AS jlink
[INFO] DOCKER>
[INFO] DOCKER> ---> 079114de2be1
[INFO] DOCKER> Successfully built 079114de2be1
[INFO] DOCKER> Successfully tagged myimage:21
[INFO] DOCKER> [myimage:21]: Built image sha256:07911
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.398 s
[INFO] Finished at: 2024-02-27T11:05:53+05:30
[INFO] ------------------------------------------------------------------------
If you specify api
in verbose
option, you will be able to see Docker API endpoints being hit:
$ mvn docker:build -Ddocker.verbose=api
[INFO] --- docker:0.45-SNAPSHOT:build (default-cli) @ dmp-build-arg-regression ---
[INFO] DOCKER> GET unix://127.0.0.1:1/version
[INFO] Building tar: /home/rokumar/work/repos/dmp-testing/dmp-build-arg-regression/target/docker/myimage/21/tmp/docker-build.tar
[INFO] DOCKER> [myimage:21]: Created docker-build.tar in 32 milliseconds
[INFO] DOCKER> GET unix://127.0.0.1:1/v1.44/images/openjdk%3A21/json
[INFO] DOCKER> GET unix://127.0.0.1:1/v1.44/images/openjdk%3A21/json
[INFO] DOCKER> GET unix://127.0.0.1:1/v1.44/images/openjdk%3A21/json
[INFO] DOCKER> GET unix://127.0.0.1:1/v1.44/images/myimage%3A21/json
[INFO] DOCKER> POST to unix://127.0.0.1:1/v1.44/build?buildargs=%7B%22FROM_IMAGE%22%3A%22openjdk%3A21%22%7D&dockerfile=Dockerfile&forcerm=1&nocache=0&squash=0&t=myimage%3A21 with contents of file /home/rokumar/work/repos/dmp-testing/dmp-build-arg-regression/target/docker/myimage/21/tmp/docker-build.tar
[INFO] DOCKER> GET unix://127.0.0.1:1/v1.44/images/myimage%3A21/json
[INFO] DOCKER> [myimage:21]: Built image sha256:07911
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
from docker-maven-plugin.
I'm getting nothing from all those variations. I think this must mean that the plugin is finding nothing to do. I don't know why that would be, but I would have to guess that it's not seeing a Dockerfile. Would the plugin print no output if that happened? We'll look closely at the config later today.
from docker-maven-plugin.
@davidmichaelkarr : I'm not able to see any image configuration in your plugin configuration. Could you please try adding this in plugin configuration?
<images>
<image>
<name>your-registry.org/yourusername/yourimagename:tag</name>
<build>
<dockerFile>Dockerfile</dockerFile>
</build>
</image>
</images>
By default plugin would automatically detect Dockerfile
if it is placed in project root directory.
Could you please check our dockerfile sample project to see how it's different from your project?
from docker-maven-plugin.
OK. Would this look better (untested)?
<images>
<image>
<name>imagenamewithtag</name>
<build>
<contextDir>${project.basedir}/src/main/docker</contextDir>
</build>
</image>
</images>
from docker-maven-plugin.
It should work given your Dockerfile has correct references as per your configured docker context directory.
from docker-maven-plugin.
It looks like the name can't have the tag, so we're adding a tags block.
from docker-maven-plugin.
default tag is added after :
in the image <name>
block, something like this:
<name>yourimagename:yourtag</name>
from docker-maven-plugin.
Well, we we were trying to have "yourtag" reference a property, like "${docker.image.tag}". That gets a syntax error. Fortunately, we are were able to do this with a tags block.
from docker-maven-plugin.
Related Issues (20)
- Buildx fails to push since 0.43.3 HOT 8
- `docker.platform` property doesn't work for `<run>` configuration
- Build arg regression with 0.44.0 HOT 5
- Can't figure out how to set the image tag HOT 3
- Quickstarts : Update Spring Boot With Jib Quickstart Spring Version to latest 2.x version HOT 1
- Build fails with podman and extra labels
- RegistryServiceTest : remove unused variable `hasImage` and `dockerFileUtilMockedStatic` HOT 3
- LogRequestor : Replace `com.google.common.base.Charsets.UTF_8` with `StandardCharsets.UTF_8` HOT 5
- Turning on JIB mode breaks multi-assembly images HOT 2
- <run><wait> no longer working correctly
- Cannot find default setter in class io.fabric8.maven.docker.config.ImageConfiguration while trying to execute docker:start goal HOT 1
- Can't use <packaging>docker</packaging> in a multi-module project HOT 1
- Version 0.44.0 fails to use the `<args>` configuration to populate the Docker build-args HOT 5
- support Dockerfile RUN <<EOF HOT 1
- docker:push failed with ARG in FROM HOT 5
- DockerComposeServiceWrapper : Use `isEmpty()` to check collection is empty HOT 3
- WatchService : Anonymous `new Runnable()` can be replaced with lambda HOT 4
- Quickstarts : Improve `it/spring-boot-with-jib` integration test HOT 2
- Ability to
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-maven-plugin.