Skip to content

Commit

Permalink
Merge pull request #1 from johanhelsing/restore-docker-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
simbleau authored Mar 9, 2023
2 parents 3aff469 + 2787e2c commit e824855
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions matchbox_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Signalling server as a docker image
FROM rust:1.66 as builder
#
# to build, run `docker build -f matchbox_server/Dockerfile` from root of the
# repository

COPY ../matchbox_protocol /usr/src/matchbox_protocol/
COPY . /usr/src/matchbox_server/
FROM rust:1.66 as builder

WORKDIR /usr/src/matchbox_server/

# cache dependency compilation in a low layer to speed up subsequent builds and
# save disk space on builders
COPY matchbox_server/Cargo.toml /usr/src/matchbox_server/Cargo.toml
COPY matchbox_protocol /usr/src/matchbox_protocol
RUN mkdir src \
&& pwd \
&& echo "fn main() {}" > src/main.rs \
&& cargo build --release

COPY matchbox_server /usr/src/matchbox_server

RUN cargo build --release

FROM debian:buster-slim
Expand Down

0 comments on commit e824855

Please sign in to comment.