Skip to content

Commit

Permalink
Merge pull request #3 from ragibkl/alpine-image
Browse files Browse the repository at this point in the history
rebuild using alpine
  • Loading branch information
ragibkl authored Mar 10, 2024
2 parents e921b11 + 90026fd commit 0351402
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 22 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,linux/arm/v7,linux/386
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64
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
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
## builder
FROM rust:1.76-bookworm AS builder
FROM alpine:3.19 AS builder

WORKDIR /code/bancuh-dns

# install system dependencies
RUN apt-get update
RUN apt-get install -y clang
RUN apk add build-base \
cargo \
clang \
clang-dev \
clang-libs \
linux-headers \
rust

# setup build dependencies
RUN cargo init .
Expand All @@ -22,17 +27,16 @@ RUN cargo build --release


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

# install runtime dependencies
RUN apt-get update
RUN apt-get install -y openssl libc6 libstdc++6 bind9
RUN apk add openssl bind libgcc libstdc++

# set default logging, can be overridden
ENV RUST_LOG=info

# copy bind config
COPY named.conf.options /etc/bind/named.conf.options
COPY named.conf /etc/bind/named.conf

# copy binary
COPY --from=builder /code/bancuh-dns/target/release/bancuh-dns /usr/local/bin/bancuh-dns
Expand Down
34 changes: 34 additions & 0 deletions named.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
options {
directory "/var/bind";

listen-on port 5353 { any; };
listen-on-v6 port 5353 { any; };

allow-query { any; };
allow-recursion { any; };
allow-transfer { none; };

prefetch 10;
max-cache-size 256m;
max-cache-ttl 600;
max-ncache-ttl 600;
};

zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "pri/localhost.zone";
allow-update { none; };
notify no;
};

zone "127.in-addr.arpa" IN {
type master;
file "pri/127.zone";
allow-update { none; };
notify no;
};
13 changes: 0 additions & 13 deletions named.conf.options

This file was deleted.

0 comments on commit 0351402

Please sign in to comment.