-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile-slim
49 lines (33 loc) · 1.27 KB
/
Dockerfile-slim
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
########################################
FROM rust:alpine AS builder
ARG CFLAGS=-Ofast
ARG BUILD_DEPS=musl-dev
WORKDIR /tmp
COPY . /tmp/
ARG RUSTFLAGS="-C link-arg=-s"
RUN apk add --no-cache ${BUILD_DEPS} &&\
echo "Building DoH Auth Proxy from source" && \
cargo build --release --no-default-features --package doh-auth-proxy && \
strip --strip-all /tmp/target/release/doh-auth-proxy
########################################
FROM alpine:latest AS runner
LABEL maintainer="Jun Kurihara"
SHELL ["/bin/sh", "-x", "-c"]
ENV SERIAL=2
ARG RUNTIME_DEPS="logrotate ca-certificates su-exec bash"
RUN apk add --no-cache ${RUNTIME_DEPS} && \
update-ca-certificates && \
find / -type d -path /proc -prune -o -type f -perm /u+s -exec chmod u-s {} \; && \
find / -type d -path /proc -prune -o -type f -perm /g+s -exec chmod g-s {} \; && \
mkdir -p /modoh/bin &&\
mkdir -p /modoh/log
COPY --from=builder /tmp/target/release/doh-auth-proxy /modoh/bin/doh-auth-proxy
COPY ./docker/run.sh /modoh
COPY ./docker/entrypoint.sh /modoh
RUN chmod +x /modoh/run.sh && \
chmod +x /modoh/entrypoint.sh
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
ENV SSL_CERT_DIR=/etc/ssl/certs
EXPOSE 53/udp 53/tcp
CMD ["/modoh/entrypoint.sh"]
ENTRYPOINT ["/modoh/entrypoint.sh"]