Skip to content

Commit 035b911

Browse files
committed
build: Use newer debian (10 -> 13), and use caching for dev builds
Jira: IAM-1908
1 parent 29d8182 commit 035b911

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ FROM rust:latest
22

33
WORKDIR /usr/src/app
44
COPY . .
5-
RUN cargo build --release --target x86_64-unknown-linux-gnu
5+
RUN cargo build --release
66

7-
FROM debian:10-slim
7+
FROM debian:13-slim
88

99
RUN apt-get update && apt-get install -y \
1010
ca-certificates \
1111
&& rm -rf /var/lib/apt/lists/*
1212

1313
WORKDIR /root/
14-
COPY --from=0 /usr/src/app/target/x86_64-unknown-linux-gnu/release/dino-park-fossil .
15-
CMD ["./dino-park-fossil"]
14+
COPY --from=0 /usr/src/app/target/release/dino-park-fossil .
15+
CMD ["./dino-park-fossil"]

Dockerfile.local

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
FROM debian:10-slim
1+
# This is mostly the same as the regular Dockerfile build, except we cache
2+
# locally.
3+
FROM rust:latest
4+
5+
WORKDIR /usr/src/app
6+
COPY . .
7+
RUN --mount=type=cache,target=/usr/src/app/target/release/build \
8+
--mount=type=cache,target=/usr/src/app/target/release/deps \
9+
--mount=type=cache,target=/usr/src/app/target/release/incremental \
10+
--mount=type=cache,target=/usr/local/cargo/registry \
11+
cargo build --release
12+
13+
FROM debian:13-slim
214

315
RUN apt-get update && apt-get install -y \
416
ca-certificates \
517
&& rm -rf /var/lib/apt/lists/*
618

719
WORKDIR /root/
8-
COPY target/release/dino-park-fossil .
20+
COPY --from=0 /usr/src/app/target/release/dino-park-fossil .
921
CMD ["./dino-park-fossil"]

0 commit comments

Comments
 (0)