Skip to content

Commit

Permalink
Use alpine to build images
Browse files Browse the repository at this point in the history
  • Loading branch information
ragibkl authored Mar 10, 2024
1 parent 067cbee commit 61208a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
project: 83rwjkn7g4
push: true
tags: ${{ steps.meta.outputs.tags }}
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rust 1.76.0
rust 1.75.0
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## builder
FROM rust:1.76-bookworm AS builder
FROM alpine:3.19 as builder

WORKDIR /code/dnsdist-acme

# setup build dependencies
RUN apk add rust cargo
RUN cargo init .
COPY Cargo.toml Cargo.lock ./
RUN cargo build --release
Expand All @@ -16,21 +17,24 @@ COPY /src/ ./src/
RUN touch ./src/main.rs
RUN cargo build --release


## dnstap
FROM golang as dnstap
FROM alpine:3.19 as dnstap
RUN apk add go
RUN go install github.com/dnstap/golang-dnstap/dnstap@v0.4.0


## runtime
FROM debian:bookworm
FROM alpine:3.19 as runtime

WORKDIR /dnsdist-acme

# install runtime dependencies
RUN apt update && apt install -y dnsdist certbot
RUN apk add gcompat certbot dnsdist

# copy binary
COPY --from=builder /code/dnsdist-acme/target/release/dnsdist-acme /usr/local/bin/dnsdist-acme
COPY --from=dnstap /go/bin/dnstap /usr/bin/.
COPY --from=dnstap /root/go/bin/dnstap /usr/bin/.

RUN mkdir -p certs html/.well-known
COPY dnsdist.conf dnsdist.conf
Expand Down

0 comments on commit 61208a1

Please sign in to comment.