Skip to content

Dockerfile: Specify files to be copied to avoid unnecessary compiling #43

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ RUN echo "fn main() { println!(\"If you see this message, you may want to clean
COPY ./plan/Cargo.* ./plan/
RUN cd ./plan/ && cargo build

COPY . .
# Coping each files only needed instead of doing `COPY . .` (all of them) in order to avoid unnecessary compiling.
# (e.g. because of modifiying `manifest.toml`.)
# NOTE: `.dockerignore` is not effective because the build context is not this directory on the test run.
# See https://docs.testground.ai/builder-library/docker-generic#usage
COPY ./plan/src ./plan/src
COPY ./plan/examples ./plan/examples

# This is in order to make sure `main.rs`s mtime timestamp is updated to avoid the dummy `main`
# remaining in the release binary.
Expand Down