Ensure that the configuration file is an absolute path in Docker build#306
Merged
XECDesign merged 3 commits intoRPi-Distro:masterfrom Jul 30, 2019
Merged
Ensure that the configuration file is an absolute path in Docker build#306XECDesign merged 3 commits intoRPi-Distro:masterfrom
XECDesign merged 3 commits intoRPi-Distro:masterfrom
Conversation
Member
|
A few merge conflicts that need to be resolved |
Contributor
Author
|
I have a better idea now to solve the issue addressed by this PR: use |
* In case of error, `&&` does not continue execution
* SC2086: Double quote to prevent globbing and word splitting.
The specific problem is in commit 2ddd7c1, where the passed config file (using the `-c` option) is now mounted inside the container using the `--volume src:dest:opt` Docker option. The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths): ./build-docker.sh -c myconfig /path/to/build-docker.sh -c myconfig # also doesn't work This commit uses `realpath` (included in coreutils) in the Docker build script to ensure that the passed configuration file is always an absolute path before passing it to Docker.
34b1d47 to
4fd20bd
Compare
Contributor
Author
|
@XECDesign I rebased and changed now the PR to use |
Member
|
Thanks again, Hugo. Much appreciated. |
fuji246
pushed a commit
to lomorage/pi-gen
that referenced
this pull request
Sep 17, 2019
RPi-Distro#306) * Use `&&` instead of `;` in Docker pipeline * In case of error, `&&` does not continue execution * Silence shellcheck warning * SC2086: Double quote to prevent globbing and word splitting. * Ensure that the configuration file is an absolute path in Docker build The specific problem is in commit 2ddd7c1, where the passed config file (using the `-c` option) is now mounted inside the container using the `--volume src:dest:opt` Docker option. The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths): ./build-docker.sh -c myconfig /path/to/build-docker.sh -c myconfig # also doesn't work This commit uses `realpath` (included in coreutils) in the Docker build script to ensure that the passed configuration file is always an absolute path before passing it to Docker.
PeterJohnson
pushed a commit
to PeterJohnson/WPILibPi
that referenced
this pull request
Dec 7, 2019
RPi-Distro#306) * Use `&&` instead of `;` in Docker pipeline * In case of error, `&&` does not continue execution * Silence shellcheck warning * SC2086: Double quote to prevent globbing and word splitting. * Ensure that the configuration file is an absolute path in Docker build The specific problem is in commit 2ddd7c1, where the passed config file (using the `-c` option) is now mounted inside the container using the `--volume src:dest:opt` Docker option. The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths): ./build-docker.sh -c myconfig /path/to/build-docker.sh -c myconfig # also doesn't work This commit uses `realpath` (included in coreutils) in the Docker build script to ensure that the passed configuration file is always an absolute path before passing it to Docker.
general-wedge
pushed a commit
to HQapp/hq-os
that referenced
this pull request
Jan 5, 2020
RPi-Distro#306) * Use `&&` instead of `;` in Docker pipeline * In case of error, `&&` does not continue execution * Silence shellcheck warning * SC2086: Double quote to prevent globbing and word splitting. * Ensure that the configuration file is an absolute path in Docker build The specific problem is in commit 2ddd7c1, where the passed config file (using the `-c` option) is now mounted inside the container using the `--volume src:dest:opt` Docker option. The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths): ./build-docker.sh -c myconfig /path/to/build-docker.sh -c myconfig # also doesn't work This commit uses `realpath` (included in coreutils) in the Docker build script to ensure that the passed configuration file is always an absolute path before passing it to Docker.
alexgg
pushed a commit
to balena-os/pi-gen
that referenced
this pull request
Jul 12, 2021
RPi-Distro#306) * Use `&&` instead of `;` in Docker pipeline * In case of error, `&&` does not continue execution * Silence shellcheck warning * SC2086: Double quote to prevent globbing and word splitting. * Ensure that the configuration file is an absolute path in Docker build The specific problem is in commit 2ddd7c1, where the passed config file (using the `-c` option) is now mounted inside the container using the `--volume src:dest:opt` Docker option. The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths): ./build-docker.sh -c myconfig /path/to/build-docker.sh -c myconfig # also doesn't work This commit uses `realpath` (included in coreutils) in the Docker build script to ensure that the passed configuration file is always an absolute path before passing it to Docker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #302 broke the Docker build script as previously documented. See below.
The specific problem is in commit 2ddd7c1, where the passed config file (using the
-coption) is now mounted inside the container using the--volume src:dest:optDocker option.If you pass a relative-path config file (like in the non-working example you gave in the PR description) you get this error after building the Docker image and starting the
pi-genbuild:The problem is that Docker requires absolute paths for mounting single files inside the container, otherwise it silently tries to mount a volume name instead as an empty directory. Therefore the Docker build no longer works with the following invocation forms (relative config-paths):
And instead the Docker build must now be invoked using absolute config-paths:
This is not really fixable because is just the way Docker works when using--volume.Instead, this PR improves the documentation overall and adds howbuild-docker.shworks currently.Update: Fixed now using
realpath(see commit 4fd20bd) that preserves old behaviour.Also I'm silencing a new shellcheck warning and slightly fixing a missing
&&in a Docker pipeline.