Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init #1

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/unbound

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.2
- uses: docker/metadata-action@v5.5.1
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: docker/build-push-action@v5.3.0
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM alpine:3.19 as builder
ARG UNBOUND_VERSION=1.19.3

WORKDIR /build
RUN apk add curl build-base openssl-dev openssl-libs-static expat-dev expat-static libevent-dev libevent-static protobuf-c-dev protobuf-c-compiler && \
curl -sSL -o root.hints https://www.internic.net/domain/named.root && \
curl -sSL https://nlnetlabs.nl/downloads/unbound/unbound-${UNBOUND_VERSION}.tar.gz | tar xz --strip 1 && \
./configure \
--disable-flto \
--disable-rpath \
--enable-dnstap \
--enable-fully-static \
--enable-subnet \
--enable-tfo-client \
--enable-tfo-server \
--localstatedir=/var \
--prefix=/usr \
--runstatedir=/run \
--sysconfdir=/etc \
--with-chroot-dir="" \
--with-libevent \
--with-pidfile=/run/unbound.pid \
--with-pthreads \
--with-ssl && \
make install


FROM alpine:3.19

WORKDIR /etc/unbound

COPY --from=builder /usr/sbin/unbound /usr/sbin/unbound
COPY --from=builder /usr/sbin/unbound-anchor /usr/sbin/unbound-anchor
COPY --from=builder /build/root.hints /etc/unbound/root.hints

RUN addgroup -S -g 1000 unbound && \
adduser -S -D -H -u 1000 -h /etc/unbound -G unbound unbound && \
install -o unbound -g unbound -m 0755 -d /var/lib/unbound && \
( unbound-anchor -a /var/lib/unbound/root.key -r /etc/unbound/root.hints || true ) && \
chown unbound:unbound /var/lib/unbound/root.key

EXPOSE 53/udp
ENTRYPOINT ["/usr/sbin/unbound", "-d"]