fix(docker): correct COPY paths for repo-root build context#824
Open
wangzishuai1987 wants to merge 1 commit into
Open
fix(docker): correct COPY paths for repo-root build context#824wangzishuai1987 wants to merge 1 commit into
wangzishuai1987 wants to merge 1 commit into
Conversation
The Dockerfile used `../` prefixes in COPY instructions, which are invalid when the build context is the repository root (as set in docker-compose.yml via `context: ..`). Docker COPY paths must be relative to the context root — `../` attempts to escape above it. Changes: - COPY ../Cargo.toml → COPY Cargo.toml - COPY ../grey/ → COPY grey/ - COPY ../tools/ → COPY tools/ - COPY ../spec/crypto-ffi/ → COPY spec/crypto-ffi/ - Update build instructions: `docker build -t grey -f grey/Dockerfile .` Refs: jarchain#231
Contributor
Genesis ReviewComparison targets:
How to reviewPost a comment with the following format (rank from best to worst): Use the short commit hashes above and To meta-review another reviewer's comment, react with 👍 or 👎. |
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.
Summary
The Dockerfile used
../prefixes in COPY instructions, which are invalid when the build context is the repository root (as configured in docker-compose.yml viacontext: ..). Docker COPY paths must be relative to the context root —../attempts to escape above it and Docker rejects the build.Fixes:
COPY ../Cargo.toml ../Cargo.lock ./→COPY Cargo.toml Cargo.lock ./COPY ../grey/ ./grey/→COPY grey/ ./grey/COPY ../tools/ ./tools/→COPY tools/ ./tools/COPY ../spec/crypto-ffi/ ./spec/crypto-ffi/→COPY spec/crypto-ffi/ ./spec/crypto-ffi/docker build -t grey -f grey/Dockerfile .Without this fix,
docker compose buildordocker build -f grey/Dockerfile .would fail with a "Forbidden path" error.Refs: #231