*: moved docker files to the packaging folder
This commit is contained in:
parent
93a597fce4
commit
7f224658e0
|
@ -86,7 +86,7 @@ matrix:
|
||||||
- node -v
|
- node -v
|
||||||
- npm -v
|
- npm -v
|
||||||
# Prepare releases
|
# Prepare releases
|
||||||
- ./release.sh
|
- ./build_release.sh
|
||||||
- ls -l dist
|
- ls -l dist
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -5,6 +5,9 @@ GOPATH := $(shell go env GOPATH)
|
||||||
JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js')
|
JSFILES = $(shell find client -path client/node_modules -prune -o -type f -name '*.js')
|
||||||
STATIC = build/static/index.html
|
STATIC = build/static/index.html
|
||||||
CHANNEL ?= release
|
CHANNEL ?= release
|
||||||
|
DOCKER_IMAGE_DEV_NAME=adguardhome-dev
|
||||||
|
DOCKERFILE=packaging/docker/Dockerfile
|
||||||
|
DOCKERFILE_HUB=packaging/docker/Dockerfile.travis
|
||||||
|
|
||||||
TARGET=AdGuardHome
|
TARGET=AdGuardHome
|
||||||
|
|
||||||
|
@ -26,6 +29,11 @@ $(TARGET): $(STATIC) *.go home/*.go dhcpd/*.go dnsfilter/*.go dnsforward/*.go
|
||||||
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(GIT_VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
|
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(GIT_VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)" -asmflags="-trimpath=$(PWD)" -gcflags="-trimpath=$(PWD)"
|
||||||
PATH=$(GOPATH)/bin:$(PATH) packr clean
|
PATH=$(GOPATH)/bin:$(PATH) packr clean
|
||||||
|
|
||||||
|
docker:
|
||||||
|
docker build -t "$(DOCKER_IMAGE_DEV_NAME)" -f "$(DOCKERFILE)" .
|
||||||
|
@echo Now you can run the docker image:
|
||||||
|
@echo docker run --name "$(DOCKER_IMAGE_DEV_NAME)" -p 53:53/tcp -p 53:53/udp -p 3000:3000/tcp $(DOCKER_IMAGE_DEV_NAME)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) cleanfast
|
$(MAKE) cleanfast
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
|
@ -4,7 +4,7 @@ set -eE
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
DOCKERFILE="Dockerfile.travis"
|
DOCKERFILE="packaging/docker/Dockerfile.hub"
|
||||||
IMAGE_NAME="adguard/adguardhome"
|
IMAGE_NAME="adguard/adguardhome"
|
||||||
|
|
||||||
if [[ "${TRAVIS_BRANCH}" == "master" ]]
|
if [[ "${TRAVIS_BRANCH}" == "master" ]]
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
FROM alpine:latest
|
||||||
|
LABEL maintainer="AdGuard Team <devteam@adguard.com>"
|
||||||
|
|
||||||
|
# Update CA certs
|
||||||
|
RUN apk --no-cache --update add ca-certificates libcap && \
|
||||||
|
rm -rf /var/cache/apk/* && \
|
||||||
|
mkdir -p /opt/adguardhome/conf /opt/adguardhome/work && \
|
||||||
|
chown -R nobody: /opt/adguardhome
|
||||||
|
|
||||||
|
COPY --chown=nobody:nogroup ./AdGuardHome /opt/adguardhome/AdGuardHome
|
||||||
|
|
||||||
|
RUN setcap 'cap_net_bind_service=+eip' /opt/adguardhome/AdGuardHome
|
||||||
|
|
||||||
|
EXPOSE 53/tcp 53/udp 67/udp 68/udp 80/tcp 443/tcp 853/tcp 3000/tcp
|
||||||
|
|
||||||
|
VOLUME ["/opt/adguardhome/conf", "/opt/adguardhome/work"]
|
||||||
|
|
||||||
|
WORKDIR /opt/adguardhome/work
|
||||||
|
|
||||||
|
#USER nobody
|
||||||
|
|
||||||
|
ENTRYPOINT ["/opt/adguardhome/AdGuardHome"]
|
||||||
|
CMD ["-h", "0.0.0.0", "-c", "/opt/adguardhome/conf/AdGuardHome.yaml", "-w", "/opt/adguardhome/work", "--no-check-update"]
|
|
@ -0,0 +1,6 @@
|
||||||
|
## Docker images
|
||||||
|
|
||||||
|
* `Dockerfile` is used for local development. Build it using `make docker` command.
|
||||||
|
|
||||||
|
* `Dockerfile.huub` is used to publish AdGuard images to Docker Hub: https://hub.docker.com/r/adguard/adguardhome
|
||||||
|
Check out `build_docker.sh` for the details.
|
Loading…
Reference in New Issue