Skip to content

fix(docker): correct COPY paths for repo-root build context#824

Open
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:fix/dockerfile-copy-paths
Open

fix(docker): correct COPY paths for repo-root build context#824
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:fix/dockerfile-copy-paths

Conversation

@wangzishuai1987
Copy link
Copy Markdown

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 via context: ..). 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/
  • Updated build instructions comment: docker build -t grey -f grey/Dockerfile .

Without this fix, docker compose build or docker build -f grey/Dockerfile . would fail with a "Forbidden path" error.

Refs: #231

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
@github-actions
Copy link
Copy Markdown
Contributor

Genesis Review

Comparison targets:

How to review

Post a comment with the following format (rank from best to worst):

/review
difficulty: <commit1>, <commit2>, ..., <commitN>, currentPR
novelty: <commit1>, <commit2>, ..., <commitN>, currentPR
design: <commit1>, <commit2>, ..., <commitN>, currentPR
verdict: merge

Use the short commit hashes above and currentPR for this PR.
Each line ranks all comparison targets + this PR from best to worst.

To meta-review another reviewer's comment, react with 👍 or 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant