1
0
mirror of https://github.com/NLnetLabs/routinator.git synced 2024-05-19 06:50:04 +00:00

use alpine as base and build dynamic routinator in docker

This commit is contained in:
Wild Kat
2019-08-17 01:15:53 +02:00
parent d4bb450504
commit 600a15ae2d

View File

@ -1,24 +1,20 @@
# -- stage 1: build static routinator with musl libc for alpine
FROM rust:1.36.0-stretch as build
FROM alpine:3.10.1 as build
RUN apt-get -yq update && \
apt-get -yq install musl-tools
RUN rustup target add x86_64-unknown-linux-musl
RUN apk add rust cargo openssl-dev
WORKDIR /tmp/routinator
COPY . .
ENV OPENSSL_STATIC=1 PKG_CONFIG_ALLOW_CROSS=1
RUN cargo build --target=x86_64-unknown-linux-musl --release --locked
RUN cargo build --target x86_64-alpine-linux-musl --release --locked
# -- stage 2: create alpine-based container with the static routinator
# executable
FROM alpine:3.10.1
COPY --from=build /tmp/routinator/target/x86_64-unknown-linux-musl/release/routinator /usr/local/bin/
COPY --from=build /tmp/routinator/target/x86_64-alpine-linux-musl/release/routinator /usr/local/bin/
# Install rsync as routinator depends on it
RUN apk add rsync
RUN apk add rsync libgcc
# Create the repository and TAL directories
RUN mkdir -p /root/.rpki-cache/repository