From 32cf02264c5ca05523c519c3833bde37d86db217 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Tue, 14 Jun 2022 20:12:31 +0300 Subject: [PATCH] cherry-pick: 4326 improve dockerfile Updates #4326. * commit 'f987c2559825923b22e910d01c2d42fb06231acc': scripts: imp docs; upd alpine Simplify Dockerfile Alpine Linux apk usage --- scripts/make/Dockerfile | 5 ++--- scripts/make/build-docker.sh | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/make/Dockerfile b/scripts/make/Dockerfile index f5a543a2..b87ee360 100644 --- a/scripts/make/Dockerfile +++ b/scripts/make/Dockerfile @@ -1,6 +1,6 @@ # A docker file for scripts/make/build-docker.sh. -FROM alpine:3.13 +FROM alpine:3.16 ARG BUILD_DATE ARG VERSION @@ -21,8 +21,7 @@ LABEL\ org.opencontainers.image.version=$VERSION # Update certificates. -RUN apk --no-cache --update add ca-certificates libcap tzdata && \ - rm -rf /var/cache/apk/* && \ +RUN apk --no-cache add ca-certificates libcap tzdata && \ mkdir -p /opt/adguardhome/conf /opt/adguardhome/work && \ chown -R nobody: /opt/adguardhome diff --git a/scripts/make/build-docker.sh b/scripts/make/build-docker.sh index 844d7da2..917e7771 100644 --- a/scripts/make/build-docker.sh +++ b/scripts/make/build-docker.sh @@ -50,6 +50,11 @@ readonly docker_image_name # Set DOCKER_OUTPUT to 'type=image,name=adguard/adguard-home,push=true' if you # want (and are allowed) to push to DockerHub. +# +# If you want to inspect the resulting image using commands like "docker image +# ls", change type to docker and also set docker_platforms to a single platform. +# +# See https://github.com/docker/buildx/issues/166. docker_output="${DOCKER_OUTPUT:-type=image,name=${docker_image_name},push=false}" readonly docker_output