-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from junkurihara/feat/docker-alpine
feat: rust alpine (musl) build
- Loading branch information
Showing
4 changed files
with
119 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
Check warning on line 24 in docker/Dockerfile-slim GitHub Actions / docker_build_and_push (slim, ./docker/Dockerfile-slim, linux/amd64, -slim, jqtype/doh-auth-proxy:...Legacy key/value format with whitespace separator should not be used
|
||
|
||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters