[#17] Wrote dockerfiles; moved everything to Docker
This commit is contained in:
parent
7243be302c
commit
93ec27bb02
6 changed files with 112 additions and 63 deletions
19
docker/Dockerfile.builder
Normal file
19
docker/Dockerfile.builder
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# We use a multi-stage build to end up with a very small final image
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
ARG MODE
|
||||
ARG RUN_TESTS
|
||||
|
||||
ENV PATH "$PATH:/root/.cargo/bin"
|
||||
# Needed for proper compiling of openssl-dev
|
||||
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Install build dependencies, rustup & rust's nightly build & toolchain
|
||||
RUN apk update && apk add --no-cache openssl-dev build-base curl && \
|
||||
{ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly; }
|
||||
|
||||
# Copy source code over to builder
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY src/ ./src/
|
||||
Reference in a new issue