-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that the configuration file is an absolute path in Docker build #306
Conversation
A few merge conflicts that need to be resolved |
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
@XECDesign I rebased and changed now the PR to use |
Thanks again, Hugo. Much appreciated. |
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.
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.
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.
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.
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.
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
-c
option) is now mounted inside the container using the--volume src:dest:opt
Docker 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-gen
build: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.sh
works 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.