From 779eef0d7118af05b1da5b9244391c7e6c3e3574 Mon Sep 17 00:00:00 2001 From: xZero707 Date: Wed, 14 Sep 2022 00:56:16 +0200 Subject: [PATCH] Simplify --- Dockerfile | 11 +++++------ build/docker-bake.hcl | 12 ++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index e87ea02..3c054b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,13 @@ ARG S6_OVERLAY_VERSION="3.0.0.2" ARG S6_OVERLAY_RELEASE="https://github.com/just-containers/s6-overlay/releases/download/" -ARG S6_OVERLAY_BIN_PAK_EXT=".tar.xz" -ARG S6_OVERLAY_BASE_PAK_EXT=".tar.xz" +ARG S6_OVERLAY_PAK_EXT=".tar.xz" # First stage - Download s6-overlay noarch base and unpack it FROM scratch AS downloader-s6-base ARG S6_OVERLAY_VERSION ARG S6_OVERLAY_RELEASE -ARG S6_OVERLAY_BASE_PAK_EXT -ADD "${S6_OVERLAY_RELEASE}/v${S6_OVERLAY_VERSION}/s6-overlay-noarch${S6_OVERLAY_BASE_PAK_EXT}" /s6overlay-base.tar.xz +ARG S6_OVERLAY_PAK_EXT +ADD "${S6_OVERLAY_RELEASE}/v${S6_OVERLAY_VERSION}/s6-overlay-noarch${S6_OVERLAY_PAK_EXT}" /s6overlay-base.tar.xz # Second stage - Download s6-overlay platform-dependent binaries and unpack @@ -16,8 +15,8 @@ FROM --platform=${TARGETPLATFORM} alpine:3.16.2 AS downloader-s6-bin ARG TARGETPLATFORM ARG S6_OVERLAY_VERSION ARG S6_OVERLAY_RELEASE -ARG S6_OVERLAY_BIN_PAK_EXT -ARG S6_OVERLAY_RELEASE_URL="${S6_OVERLAY_RELEASE}/v${S6_OVERLAY_VERSION}/s6-overlay-${TARGETPLATFORM}${S6_OVERLAY_BIN_PAK_EXT}" +ARG S6_OVERLAY_PAK_EXT +ARG S6_OVERLAY_RELEASE_URL="${S6_OVERLAY_RELEASE}/v${S6_OVERLAY_VERSION}/s6-overlay-${TARGETPLATFORM}${S6_OVERLAY_PAK_EXT}" RUN apk add --no-cache wget \ && wget -O /s6overlay-bin.tar.xz "$(echo ${S6_OVERLAY_RELEASE_URL} | sed 's/linux\///g' | sed 's/amd64/x86_64/g' | sed 's/arm64/aarch64/g' | sed 's/arm\/v7/armhf/g')" diff --git a/build/docker-bake.hcl b/build/docker-bake.hcl index 55c2bf2..dbf881c 100644 --- a/build/docker-bake.hcl +++ b/build/docker-bake.hcl @@ -63,8 +63,7 @@ target "3_0_0_0" { tags = ["docker.io/nlss/s6-rootfs:3.0.0.0", "docker.io/nlss/s6-rootfs:3.0.0.0-1"] args = { S6_OVERLAY_VERSION = "3.0.0.0-1" - S6_OVERLAY_BIN_PAK_EXT = "-3.0.0.0-1.tar.xz" - S6_OVERLAY_BASE_PAK_EXT = "-3.0.0.0-1.tar.xz" + S6_OVERLAY_PAK_EXT = "-3.0.0.0-1.tar.xz" } } @@ -73,8 +72,7 @@ target "3_0_0_1" { tags = ["docker.io/nlss/s6-rootfs:3.0.0.1"] args = { S6_OVERLAY_VERSION = "3.0.0.1" - S6_OVERLAY_BIN_PAK_EXT = "-3.0.0.1.tar.xz" - S6_OVERLAY_BASE_PAK_EXT = "-3.0.0.1.tar.xz" + S6_OVERLAY_PAK_EXT = "-3.0.0.1.tar.xz" } } @@ -83,8 +81,7 @@ target "3_0_0_2" { tags = ["docker.io/nlss/s6-rootfs:3.0.0.2"] args = { S6_OVERLAY_VERSION = "3.0.0.2" - S6_OVERLAY_BIN_PAK_EXT = "-3.0.0.2.tar.xz" - S6_OVERLAY_BASE_PAK_EXT = "-3.0.0.2.tar.xz" + S6_OVERLAY_PAK_EXT = "-3.0.0.2.tar.xz" } } @@ -93,8 +90,7 @@ target "3_0_0_2-2" { tags = ["docker.io/nlss/s6-rootfs:3.0.0.2-2", "docker.io/nlss/s6-rootfs:3.0"] args = { S6_OVERLAY_VERSION = "3.0.0.2-2" - S6_OVERLAY_BIN_PAK_EXT = "-3.0.0.2-2.tar.xz" - S6_OVERLAY_BASE_PAK_EXT = "-3.0.0.2-2.tar.xz" + S6_OVERLAY_PAK_EXT = "-3.0.0.2-2.tar.xz" } }