Enhance direct Dockerfile support
See original GitHub issueThe following features should be added for a better experience when using Dockerfiles directly:
- It should be possible to support multiple Dockerfiles (as Docker 1.6 does). The idea is to use
dockerFile
instead ofdockerFileDir
and the base directory is then set to the directory of this Dockerfile (ifdockerFileDir
is used, then the name of the dockerfile is supposed to beDockerfile
) - Allow variable substitution within Dockerfiles (as for other Maven resources).
- Allows special variables for:
ADD_ASSEMBLY
will add the proper ADD statements for the assmbly
- Allow the configuration of the assembly directory used during the build. See also #203
- Optional: Allow optimizations like compressing all subsequent RUN statements into a single RUN statement or so.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Best practices for writing Dockerfiles - Docker Documentation
This document covers recommended best practices and methods for building efficient images. Docker builds images automatically by reading the instructions from a ...
Read more >Docker development best practices - Docker Documentation
Docker development best practices. The following development patterns have proven to be helpful for people building applications with Docker.
Read more >Image-building best practices - Docker Documentation
When you have built an image, it is a good practice to scan it for security vulnerabilities using the docker scan command. Docker...
Read more >docker build - Docker Documentation
Support for this feature is tracked in buildkit#1684. ... To increase the build's performance, you can exclude files and directories by adding a ......
Read more >BuildKit - Docker Documentation
It comes with new and much improved functionality for improving your builds' ... It also supports features not exposed in Dockerfiles, like direct...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you could add some logging output as follows, it’d probably save a few people some time.
What threw me is that d-m-p creates a temporary directory but in
dockerFileMode
target/<dockerOutputDirectory>/<imageName>/build
and it puts the Dockerfile in there, but it doesn’t include the other files which are in
<dockerFileDir>
The only way to be sure that they were included was to either run the image and see if it died, or attach to the image and look around, or open up the
outputDirectory.tar
with 7zip and check.It would be cool if there was some logging at info level rather than just the following (I use
verbose=true
) :[INFO] --- docker-maven-plugin:0.22.1:build (build-docker-image) @ tardis --- [INFO] Building tar: C:\dev\workspace\tardis\target\docker-build\xyz987\tmp\docker-build.tar [INFO] DOCKER> [xyz987/tardis:latest]: Created docker-build.tar in 170 milliseconds
Reiterating on the Dockerfile support in general, I have more and more the feeling that we should separate the two ways of building images more prominently (and not only by a low-level
dockerFileDir
which can be easily overlooked). Also because of potentially other ways to build images (see e.g. #414)We could add extra configuration field
<dockerfileBuild>
on the same level as<build>
for make the distinction clear. This could work also with a<type>
field in the<build>
section, but that would not easily be backwards compatible.Thoughts on this ?