File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.7-labs
12FROM golang:1.19-alpine
23
34ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
45
56WORKDIR /app
67
7- COPY go.mod go.sum ./
8+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
9+ COPY --exclude=.git --exclude=README.md . /app
810
911RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs -r go get
1012
13+
14+ # Once the heave steps are done, we can copy all files back
15+ COPY . /app
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.7-labs
12FROM python:3.11-alpine
23
34RUN pip install pipenv
45
5- COPY Pipfile /app/Pipfile
6- COPY Pipfile.lock /app/Pipfile.lock
76
87WORKDIR /app
8+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
9+ COPY --exclude=.git --exclude=README.md . /app
910
1011ENV WORKON_HOME=/venvs
1112
@@ -14,4 +15,6 @@ RUN pipenv install
1415# Force environment creation
1516RUN pipenv run python3 -c "1+1"
1617
17- ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"
18+ ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Pipfile,Pipfile.lock"
19+ # Once the heave steps are done, we can copy all files back
20+ COPY . /app
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1.7-labs
12FROM rust:1.70-buster
23
3- COPY Cargo.toml /app/Cargo.toml
4- COPY Cargo.lock /app/Cargo.lock
54
65RUN mkdir /app/src
76RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs
87
98WORKDIR /app
9+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
10+ COPY --exclude=.git --exclude=README.md . /app
1011RUN cargo build --release --target-dir=/tmp/codecrafters-grep-target
1112
1213RUN cargo clean -p grep-starter-rust --release --target-dir=/tmp/codecrafters-grep-target
@@ -18,3 +19,6 @@ RUN chmod +x /codecrafters-precompile.sh
1819
1920ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock"
2021
22+
23+ # Once the heave steps are done, we can copy all files back
24+ COPY . /app
You can’t perform that action at this time.
0 commit comments