fej/docker/Dockerfile.builder

18 lines
648 B
Docker
Raw Normal View History

# Our entire toolchain runs in alpine
FROM alpine:latest AS builder
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
2021-04-17 10:12:37 +02:00
RUN apk update && apk add --no-cache openssl-dev curl postgresql-dev libgcc musl-dev gcc && \
2021-04-16 23:20:22 +02:00
{ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly; } && \
rustup target add x86_64-unknown-linux-musl --toolchain nightly
# Copy source code over to builder
COPY Cargo.toml Cargo.lock ./
COPY src/ ./src/