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

36 lines
1.1 KiB
Docker

# -- stage 1: build static routinator with musl libc for alpine
FROM rust:1.36.0-stretch as build
RUN apt-get -yq update && \
apt-get -yq install musl-tools libssl-dev
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /tmp/routinator
COPY . .
RUN cargo build --target=x86_64-unknown-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/
# Install rsync as routinator depends on it
RUN apk add rsync
# Create the repository and TAL directories
RUN mkdir -p /root/.rpki-cache/repository
RUN mkdir -p /root/.rpki-cache/tals
# Due to ARIN TAL distribution terms, we can't do this here.
# An individual user, however, might want to anyway - after reviewing
# https://www.arin.net/resources/rpki/tal.html.
#
#COPY --from=build /tmp/routinator/tals/*.tal /root/.rpki-cache/tals/
EXPOSE 3323/tcp
EXPOSE 9556/tcp
ENTRYPOINT ["routinator"]
CMD ["server", "--rtr", "0.0.0.0:3323", "--http", "0.0.0.0:9556"]