Skip to content

Commit

Permalink
feat(adguard-home): add image
Browse files Browse the repository at this point in the history
  • Loading branch information
f-bn committed Apr 13, 2024
1 parent 5136fc2 commit 21f5588
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-adguard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Build AdGuard Home image
on:
push:
branches:
- main
paths:
- adguard-home/**
- .github/workflows/build-adguard-home.yml
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
version: ['0.107.48']
steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image to registry
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: ./adguard-home
file: ./adguard-home/Dockerfile
push: true
build-args: |
VERSION=${{ matrix.version }}
tags: |
ghcr.io/f-bn/adguard-home:${{ matrix.version }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repository contains my personal custom OCI containers images.

#### Images

- [adguard-home](./adguard-home/)
- [ferretdb](./ferretdb/)
- [navidrome](./navidrome/)
- [pgbouncer](./pgbouncer/)
Expand Down
44 changes: 44 additions & 0 deletions adguard-home/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# --- Build stage ---
FROM cgr.dev/chainguard/wolfi-base:latest AS build

ARG TARGETOS
ARG TARGETARCH
ARG VERSION=0.107.48

RUN apk add --no-cache libcap-utils

WORKDIR /build

ADD https://github.com/AdguardTeam/AdGuardHome/releases/download/v${VERSION}/AdGuardHome_${TARGETOS}_${TARGETARCH}.tar.gz /build/

RUN set -ex ; \
tar -xzf /build/AdGuardHome_${TARGETOS}_${TARGETARCH}.tar.gz --strip-components=2 ; \
setcap 'cap_net_bind_service=+ep' /build/AdGuardHome

# --- Final stage ---
FROM cgr.dev/chainguard/wolfi-base:latest

COPY --from=build --chmod=755 /build/AdGuardHome /usr/bin/adguard-home

RUN set -ex ; \
mkdir -p /etc/adguard-home /var/lib/adguard-home ; \
chown nonroot:nonroot /var/lib/adguard-home /etc/adguard-home

EXPOSE 53/tcp 53/udp 67/udp 68/udp 80/tcp 443/tcp 443/udp 853/tcp \
853/udp 3000/tcp 3000/udp 5443/tcp 5443/udp 6060/tcp

USER nonroot

VOLUME [ "/var/lib/adguard-home" ]

ENTRYPOINT [ "/usr/bin/adguard-home" ]

CMD [ "-c", "/etc/adguard-home/config.yaml", \
"-w", "/var/lib/adguard-home" ]

LABEL \
org.opencontainers.image.title="adguard-home" \
org.opencontainers.image.source="https://github.com/f-bn/containers-images/adguard-home" \
org.opencontainers.image.description="Network-wide ads & trackers blocking DNS server" \
org.opencontainers.image.licenses="GPL-3.0-or-later" \
org.opencontainers.image.authors="Florian Bobin <[email protected]>"
14 changes: 14 additions & 0 deletions adguard-home/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## General informations

Custom AdGuard Home image from official binary.

## AdGuard Home configuration

This image doesn't come with a default AdGuard Home configuration. You can bring your own configuration to the container (e.g using Docker):

```shell
# Since AdGuard is generating configuration during startup, configuration volume must be mounted R/W
$ docker run [options] -v /path/to/configdir:/etc/adguard-home:rw ghcr.io/f-bn/adguard-home:0.107.48
```

More informations about AdGuard Home configuration [here](https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration).

0 comments on commit 21f5588

Please sign in to comment.