[#17] Wrote dockerfiles; moved everything to Docker

This commit is contained in:
Jef Roosens 2021-04-12 17:39:52 +02:00
parent 7243be302c
commit 93ec27bb02
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
6 changed files with 112 additions and 63 deletions

19
docker/Dockerfile.builder Normal file
View 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/