-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (26 loc) · 856 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM rust:alpine as rust-build
RUN apk add musl-dev
WORKDIR /rust
COPY Cargo.* /rust/
RUN \
mkdir src && \
echo "fn main() {}" > src/main.rs && \
cargo build --release && \
rm -rf src
COPY src /rust/src
RUN cargo build --release
FROM alpine
ARG S6_OVERLAY_VERSION=3.1.0.1
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN \
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
rm /tmp/*.tar.xz && \
apk add --no-cache coredns
COPY --from=rust-build /rust/target/*/localns /bin/localns
COPY etc /etc/
ENV LOCALNS_CONFIG=/etc/localns/config.yaml
EXPOSE 53/udp
EXPOSE 53/tcp
ENTRYPOINT ["/init"]