question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhance direct Dockerfile support

See original GitHub issue

The 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 of dockerFileDir and the base directory is then set to the directory of this Dockerfile (if dockerFileDir is used, then the name of the dockerfile is supposed to be Dockerfile)
  • 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:open
  • Created 8 years ago
  • Reactions:2
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adam42acommented, Sep 27, 2017

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

1reaction
rhusscommented, Mar 22, 2016

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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found