From c1f6da2b520c9aae2aa972cefb12d26bbbd1d3e2 Mon Sep 17 00:00:00 2001 From: Eugene Zbiranik Date: Mon, 11 Feb 2019 15:10:36 +0300 Subject: [PATCH 1/4] Build latest from tag branch, edge from master --- Dockerfile.travis | 11 ++++++----- build_docker.sh | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Dockerfile.travis b/Dockerfile.travis index 31bb339c..4aa05e6c 100644 --- a/Dockerfile.travis +++ b/Dockerfile.travis @@ -3,13 +3,14 @@ LABEL maintainer="AdGuard Team " # Update CA certs RUN apk --no-cache --update add ca-certificates && \ - rm -rf /var/cache/apk/* + rm -rf /var/cache/apk/* && mkdir -p /opt/adguardhome -COPY ./AdGuardHome /AdGuardHome + +COPY ./AdGuardHome /opt/adguardhome/AdGuardHome EXPOSE 53 3000 -VOLUME /data +VOLUME ["/opt/adguardhome/conf", "/opt/adguardhome/work"] -ENTRYPOINT ["/AdGuardHome"] -CMD ["-h", "0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["/opt/adguardhome/AdGuardHome"] +CMD ["-h", "0.0.0.0", "-c", "/opt/adguardhome/conf/AdGuardHome.yaml", "-w", "/opt/adguardhome/work"] diff --git a/build_docker.sh b/build_docker.sh index 684e1ea9..1123d269 100755 --- a/build_docker.sh +++ b/build_docker.sh @@ -5,9 +5,11 @@ set -o pipefail set -x DOCKERFILE="Dockerfile.travis" -if [ "${TRAVIS_BRANCH}" == "master" ] +IMAGE_NAME="adguard/adguardhome" + +if [[ "${TRAVIS_BRANCH}" == "master" ]] then - VERSION="latest" + VERSION="edge" else VERSION=`git describe --abbrev=4 --dirty --always --tags` fi @@ -37,11 +39,11 @@ build_image() { ;; esac - if [ "${GOOS}" == "linux" ] && [ "${GOARCH}" == "amd64" ] + if [[ "${GOOS}" == "linux" ]] && [[ "${GOARCH}" == "amd64" ]] then - image="adguard/adguardhome:${VERSION}" + image="${IMAGE_NAME}:${VERSION}" else - image="adguard/adguardhome:${imageArch}-${VERSION}" + image="${IMAGE_NAME}:${imageArch}-${VERSION}" fi make cleanfast; CGO_DISABLED=1 make @@ -50,6 +52,13 @@ build_image() { docker tag "multiarch/alpine:${alpineArch}" "$from" docker build -t "${image}" -f ${DOCKERFILE} . docker push ${image} + if [[ "${VERSION}" != "edge" ]] + then + latest=${image/$VERSION/latest} + docker tag "${image}" "${latest}" + docker push ${latest} + docker rmi ${latest} + fi docker rmi "$from" } From 6d7d10ec3870ea0d412f6b5e7c26cfdcce414dc7 Mon Sep 17 00:00:00 2001 From: Eugene Zbiranik Date: Mon, 11 Feb 2019 15:17:49 +0300 Subject: [PATCH 2/4] Fix to go along with new concept --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3c13952..3b93e081 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,13 +12,13 @@ LABEL maintainer="AdGuard Team " # Update CA certs RUN apk --no-cache --update add ca-certificates && \ - rm -rf /var/cache/apk/* + rm -rf /var/cache/apk/* && mkdir -p /opt/adguardhome -COPY --from=build /src/AdGuardHome/AdGuardHome /AdGuardHome +COPY --from=build /src/AdGuardHome/AdGuardHome /opt/adguardhome/AdGuardHome EXPOSE 53 3000 -VOLUME /data +VOLUME ["/opt/adguardhome/conf", "/opt/adguardhome/work"] -ENTRYPOINT ["/AdGuardHome"] -CMD ["-h", "0.0.0.0"] \ No newline at end of file +ENTRYPOINT ["/opt/adguardhome/AdGuardHome"] +CMD ["-h", "0.0.0.0", "-c", "/opt/adguardhome/conf/AdGuardHome.yaml", "-w", "/opt/adguardhome/work"] \ No newline at end of file From 899b26725e92206fb30e21e43a20f74f84bb1e6e Mon Sep 17 00:00:00 2001 From: Eugene Zbiranik Date: Mon, 11 Feb 2019 16:56:11 +0300 Subject: [PATCH 3/4] doc --- Docker.md | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 Docker.md diff --git a/Docker.md b/Docker.md new file mode 100644 index 00000000..f8b1a581 --- /dev/null +++ b/Docker.md @@ -0,0 +1,151 @@ +  +

+ AdGuard Home +

+

Privacy protection center for you and your devices

+

+ Free and open source, powerful network-wide ads & trackers blocking DNS server. +

+ +

+ AdGuard.com | + Wiki | + Reddit | + Twitter | + Telegram +

+ + Build status + + + Code Coverage + + + Go Report Card + + + GolangCI + + + Latest release + +

+ +
+ +

+ +

+ +
+ +# AdGuard Home + +AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, it'll cover ALL your home devices, and you don't need any client-side software for that. + +## How does AdGuard Home work? + +AdGuard Home operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers. It's based on software we use for our public [AdGuard DNS](https://adguard.com/en/adguard-dns/overview.html) servers -- both share a lot of common code. + +## How is this different from public AdGuard DNS servers? + +Running your own AdGuard Home server allows you to do much more than using a public DNS server. + +* Choose what exactly will the server block or not block; +* Monitor your network activity; +* Add your own custom filtering rules; + +In the future, AdGuard Home is supposed to become more than just a DNS server. + +## Supported tags / architectures + +`adguard/adguardhome` image is built for different architectures and supports the following tags: + +* `latest` - latest **stable** build from the last tagged release. +* `edge` - latest build from the repository **master** trunk, may be unstable. +* `$version` - specific release e.g. `v0.92`. + +### Tags for different architectures + +* **ARM64** - 64bit ARM build + * `arm64-latest` + * `arm64-edge` +* **ARMHF** - 32bit ARM build + * `armhf-latest` + * `armhf-edge` +* **i386** - x86 build + * `i386-latest` + * `i386-edge` +* **AMD64** - x86_64 build **default** + * `latest` + * `edge` + +## Usage + +To run `AdGuardHome` image: + +```bash +docker run -d -p 53:53 -p 53:53/udp -p 3000:3000 adguard/adguardhome +``` + +Now open the browser and navigate to http://DOCKER_HOST_IP:3000/ to control your AdGuard Home service. + +## Persistent configuration / data + +There are several ways to store data used by applications that run in Docker containers. +We encourage users of the `adguard/adguardhome` images to familiarize themselves with the options available, including: + +* Let Docker manage the storage of data by writing the files to disk on the host system using its own internal volume management. +This is the default and is easy and fairly transparent to the user. +The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers. + +* Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. +This places the files in a known location on the host system, and makes it easy for tools and applications on +the host system to access the files. The downside is that the user needs to make sure that the directory exists, and +that e.g. directory permissions and other security mechanisms on the host system are set up correctly. + +The image exposes two volumes for data/configuration persistence: +* Configuration - `/opt/adguardhome/conf` +* Filters and data - `/opt/adguardhome/work` + +The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above: + +Create a **data** directory on a suitable volume on your host system, e.g. **/my/own/workdir**. + +Create a **config** directory on a suitable volume on your host system, e.g. **/my/own/confdir**. + +Start your `adguard/adguardhome` container like this: + +``` +docker run --name adguardhome -v /my/own/workdir:/opt/adguardhome/work -v /my/own/confdir:/opt/adguardhome/conf -d -p 53:53 -p 53:53/udp -p 3000:3000 adguard/adguardhome +``` + +The `-v /my/own/workdir:/opt/adguardhome/work` part of the command mounts the `/my/own/workdir` directory from the underlying host system as `/opt/adguardhome/work` inside the container, +where AdGuardHome by default will write its data files. + + +### Additional configuration + +Upon the first execution, a file named `AdGuardHome.yaml` will be created, with default values written in it. +You can modify the file while your AdGuard Home container is not running. +Otherwise, any changes to the file will be lost because the running program will overwrite them. + +Settings are stored in [YAML format](https://en.wikipedia.org/wiki/YAML), possible parameters that you can configure are listed on [Project homepage](https://github.com/AdguardTeam/AdGuardHome). + +## How to update + +```bash +docker pull adguard/adguardhome +``` + +To update the image for a specific architecture e.g. `arm64`: + +```bash +docker pull adguard/adguardhome:arm64-latest +``` + +## Reporting issues + +If you run into any problem or have a suggestion, head to [this page](https://github.com/AdguardTeam/AdGuardHome/issues) and click on the `New issue` button. + + From 27ea739cfdc782daeca07ae8af6bb8f6ef6d65b3 Mon Sep 17 00:00:00 2001 From: Eugene Zbiranik Date: Mon, 11 Feb 2019 19:38:45 +0300 Subject: [PATCH 4/4] fix --- Docker.md | 59 +------------------------------------------------------ 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/Docker.md b/Docker.md index f8b1a581..f98e0c46 100644 --- a/Docker.md +++ b/Docker.md @@ -1,45 +1,4 @@ -  -

- AdGuard Home -

-

Privacy protection center for you and your devices

-

- Free and open source, powerful network-wide ads & trackers blocking DNS server. -

- -

- AdGuard.com | - Wiki | - Reddit | - Twitter | - Telegram -

- - Build status - - - Code Coverage - - - Go Report Card - - - GolangCI - - - Latest release - -

- -
- -

- -

- -
- -# AdGuard Home +# AdGuard Home - Docker AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, it'll cover ALL your home devices, and you don't need any client-side software for that. @@ -47,16 +6,6 @@ AdGuard Home is a network-wide software for blocking ads & tracking. After you s AdGuard Home operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers. It's based on software we use for our public [AdGuard DNS](https://adguard.com/en/adguard-dns/overview.html) servers -- both share a lot of common code. -## How is this different from public AdGuard DNS servers? - -Running your own AdGuard Home server allows you to do much more than using a public DNS server. - -* Choose what exactly will the server block or not block; -* Monitor your network activity; -* Add your own custom filtering rules; - -In the future, AdGuard Home is supposed to become more than just a DNS server. - ## Supported tags / architectures `adguard/adguardhome` image is built for different architectures and supports the following tags: @@ -143,9 +92,3 @@ To update the image for a specific architecture e.g. `arm64`: ```bash docker pull adguard/adguardhome:arm64-latest ``` - -## Reporting issues - -If you run into any problem or have a suggestion, head to [this page](https://github.com/AdguardTeam/AdGuardHome/issues) and click on the `New issue` button. - -