2018-11-22 01:03:58 +01:00
|
|
|
# -- stage 1: build static routinator with musl libc for alpine
|
2019-03-02 20:27:45 +01:00
|
|
|
FROM rust:1.33.0-stretch as build
|
2018-11-22 01:03:58 +01:00
|
|
|
|
|
|
|
RUN apt-get -yq update && \
|
|
|
|
apt-get -yq install musl-tools
|
|
|
|
|
|
|
|
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
|
2019-03-15 08:45:01 +01:00
|
|
|
FROM alpine:3.9.2
|
2018-11-22 01:03:58 +01:00
|
|
|
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
|
|
|
|
|
2018-11-22 01:17:16 +01:00
|
|
|
# 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
|
2018-11-22 01:03:58 +01:00
|
|
|
# If this is in place, mouting a volume at run time with this file is no longer necessary.
|
|
|
|
#
|
|
|
|
# ADD https://www.arin.net/resources/rpki/arin-rfc7730.tal /root/.rpki-cache/tals/arin.tal
|
|
|
|
|
2018-11-22 13:26:59 +01:00
|
|
|
# Prepare a directory for TALs
|
|
|
|
RUN mkdir -p /root/.rpki-cache/tals
|
|
|
|
|
2018-11-22 20:31:02 +01:00
|
|
|
# Copy over TALs from source
|
|
|
|
COPY --from=build /tmp/routinator/tals/*.tal /root/.rpki-cache/tals/
|
|
|
|
|
2018-11-22 01:03:58 +01:00
|
|
|
EXPOSE 3323/tcp
|
2019-03-15 08:45:01 +01:00
|
|
|
CMD ["routinator", "rtrd", "-a", "-l", "0.0.0.0:3323"]
|