2018-11-22 01:03:58 +01:00
|
|
|
# -- stage 1: build static routinator with musl libc for alpine
|
2019-05-30 22:29:46 +02:00
|
|
|
FROM rust:1.35.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
|
|
|
|
|
2019-05-29 16:48:49 +02:00
|
|
|
# -- stage 2: create alpine-based container with the static routinator
|
|
|
|
# executable
|
2019-05-12 14:30:10 +02:00
|
|
|
FROM alpine:3.9.4
|
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
|
|
|
|
|
2019-05-29 16:48:49 +02:00
|
|
|
# Create the repository and TAL directories
|
|
|
|
RUN mkdir -p /root/.rpki-cache/repository
|
2018-11-22 13:26:59 +01:00
|
|
|
RUN mkdir -p /root/.rpki-cache/tals
|
|
|
|
|
2019-05-29 16:48:49 +02: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.
|
|
|
|
#
|
|
|
|
#COPY --from=build /tmp/routinator/tals/*.tal /root/.rpki-cache/tals/
|
2018-11-22 20:31:02 +01:00
|
|
|
|
2018-11-22 01:03:58 +01:00
|
|
|
EXPOSE 3323/tcp
|
2019-06-03 12:52:34 +02:00
|
|
|
EXPOSE 9556/tcp
|
2019-05-29 16:48:49 +02:00
|
|
|
ENTRYPOINT ["routinator"]
|
2019-06-03 12:52:34 +02:00
|
|
|
CMD ["server", "--rtr", "0.0.0.0:3323", "--http", "0.0.0.0:9556"]
|