From ab0c3fb48532bec66c09ee1013584da117ec69ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20B=C3=BCrgi?= Date: Wed, 17 Oct 2018 23:25:01 +0200 Subject: [PATCH] Improve documentation on referencing build artifacts See: - spotify/dockerfile-maven#101 - spotify/dockerfile-maven#209 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index ce9ce3dc..4c3a4ed6 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,18 @@ ARG JAR_FILE ADD target/${JAR_FILE} /usr/share/myservice/myservice.jar ``` +**Important note** + +The most Maven-ish way to reference the build artifact would probably +be to use the `project.build.directory` variable for referencing the +'target'-directory. However, this results in an absolute path, which +is not supported by the ADD command in the Dockerfile. Any such source +must be inside the *context* of the Docker build and therefor must be +referenced by a *relative path*. See https://github.com/spotify/dockerfile-maven/issues/101 + +*Do **not** use `${project.build.directory}` as a way to reference your +build directory.* + ## What does it give me? There are many advantages to using this plugin for your builds.