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
1
2
FROM golang:1.19-alpine
2
3
3
4
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
4
5
5
6
WORKDIR /app
6
7
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
8
10
9
11
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs -r go get
10
12
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
1
2
FROM python:3.11-alpine
2
3
3
4
RUN pip install pipenv
4
5
5
- COPY Pipfile /app/Pipfile
6
- COPY Pipfile.lock /app/Pipfile.lock
7
6
8
7
WORKDIR /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
9
10
10
11
ENV WORKON_HOME=/venvs
11
12
@@ -14,4 +15,6 @@ RUN pipenv install
14
15
# Force environment creation
15
16
RUN pipenv run python3 -c "1+1"
16
17
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
1
2
FROM rust:1.70-buster
2
3
3
- COPY Cargo.toml /app/Cargo.toml
4
- COPY Cargo.lock /app/Cargo.lock
5
4
6
5
RUN mkdir /app/src
7
6
RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs
8
7
9
8
WORKDIR /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
10
11
RUN cargo build --release --target-dir=/tmp/codecrafters-grep-target
11
12
12
13
RUN cargo clean -p grep-starter-rust --release --target-dir=/tmp/codecrafters-grep-target
@@ -18,3 +19,6 @@ RUN chmod +x /codecrafters-precompile.sh
18
19
19
20
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock"
20
21
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