From 2c6bd8c9dc67d3e0208e1873d8bf3fef6d8f9aa3 Mon Sep 17 00:00:00 2001 From: Jeremy Lin Date: Sun, 22 Jan 2023 01:01:02 -0800 Subject: [PATCH] Rename `.buildx` Dockerfiles to `.buildkit` This is a more accurate name, since these Dockerfiles require BuildKit, not Buildx. --- .github/workflows/release.yml | 5 ++++- docker/Dockerfile.j2 | 2 +- docker/Makefile | 4 ++-- docker/amd64/{Dockerfile.buildx => Dockerfile.buildkit} | 0 ...{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} | 0 docker/arm64/{Dockerfile.buildx => Dockerfile.buildkit} | 0 ...{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} | 0 docker/armv6/{Dockerfile.buildx => Dockerfile.buildkit} | 0 ...{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} | 0 docker/armv7/{Dockerfile.buildx => Dockerfile.buildkit} | 0 ...{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} | 0 hooks/build | 6 +++--- 12 files changed, 10 insertions(+), 7 deletions(-) rename docker/amd64/{Dockerfile.buildx => Dockerfile.buildkit} (100%) rename docker/amd64/{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} (100%) rename docker/arm64/{Dockerfile.buildx => Dockerfile.buildkit} (100%) rename docker/arm64/{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} (100%) rename docker/armv6/{Dockerfile.buildx => Dockerfile.buildkit} (100%) rename docker/armv6/{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} (100%) rename docker/armv7/{Dockerfile.buildx => Dockerfile.buildkit} (100%) rename docker/armv7/{Dockerfile.buildx.alpine => Dockerfile.buildkit.alpine} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3690ceb..32f6abc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,10 @@ jobs: ports: - 5000:5000 env: - DOCKER_BUILDKIT: 1 # Disabled for now, but we should look at this because it will speedup building! + # Use BuildKit (https://docs.docker.com/build/buildkit/) for better + # build performance and the ability to copy extended file attributes + # (e.g., for executable capabilities) across build phases. + DOCKER_BUILDKIT: 1 # DOCKER_REPO/secrets.DOCKERHUB_REPO needs to be 'index.docker.io//' DOCKER_REPO: ${{ secrets.DOCKERHUB_REPO }} SOURCE_COMMIT: ${{ github.sha }} diff --git a/docker/Dockerfile.j2 b/docker/Dockerfile.j2 index 82e8527f..095c295a 100644 --- a/docker/Dockerfile.j2 +++ b/docker/Dockerfile.j2 @@ -50,7 +50,7 @@ {% else %} {% set package_arch_target_param = "" %} {% endif %} -{% if "buildx" in target_file %} +{% if "buildkit" in target_file %} {% set mount_rust_cache = "--mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry " %} {% else %} {% set mount_rust_cache = "" %} diff --git a/docker/Makefile b/docker/Makefile index 8c939cba..d7c0ab80 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -8,8 +8,8 @@ all: $(OBJECTS) %/Dockerfile.alpine: Dockerfile.j2 render_template ./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" -%/Dockerfile.buildx: Dockerfile.j2 render_template +%/Dockerfile.buildkit: Dockerfile.j2 render_template ./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" -%/Dockerfile.buildx.alpine: Dockerfile.j2 render_template +%/Dockerfile.buildkit.alpine: Dockerfile.j2 render_template ./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" diff --git a/docker/amd64/Dockerfile.buildx b/docker/amd64/Dockerfile.buildkit similarity index 100% rename from docker/amd64/Dockerfile.buildx rename to docker/amd64/Dockerfile.buildkit diff --git a/docker/amd64/Dockerfile.buildx.alpine b/docker/amd64/Dockerfile.buildkit.alpine similarity index 100% rename from docker/amd64/Dockerfile.buildx.alpine rename to docker/amd64/Dockerfile.buildkit.alpine diff --git a/docker/arm64/Dockerfile.buildx b/docker/arm64/Dockerfile.buildkit similarity index 100% rename from docker/arm64/Dockerfile.buildx rename to docker/arm64/Dockerfile.buildkit diff --git a/docker/arm64/Dockerfile.buildx.alpine b/docker/arm64/Dockerfile.buildkit.alpine similarity index 100% rename from docker/arm64/Dockerfile.buildx.alpine rename to docker/arm64/Dockerfile.buildkit.alpine diff --git a/docker/armv6/Dockerfile.buildx b/docker/armv6/Dockerfile.buildkit similarity index 100% rename from docker/armv6/Dockerfile.buildx rename to docker/armv6/Dockerfile.buildkit diff --git a/docker/armv6/Dockerfile.buildx.alpine b/docker/armv6/Dockerfile.buildkit.alpine similarity index 100% rename from docker/armv6/Dockerfile.buildx.alpine rename to docker/armv6/Dockerfile.buildkit.alpine diff --git a/docker/armv7/Dockerfile.buildx b/docker/armv7/Dockerfile.buildkit similarity index 100% rename from docker/armv7/Dockerfile.buildx rename to docker/armv7/Dockerfile.buildkit diff --git a/docker/armv7/Dockerfile.buildx.alpine b/docker/armv7/Dockerfile.buildkit.alpine similarity index 100% rename from docker/armv7/Dockerfile.buildx.alpine rename to docker/armv7/Dockerfile.buildkit.alpine diff --git a/hooks/build b/hooks/build index 96f04d15..223b4153 100755 --- a/hooks/build +++ b/hooks/build @@ -34,9 +34,9 @@ for label in "${LABELS[@]}"; do LABEL_ARGS+=(--label "${label}") done -# Check if DOCKER_BUILDKIT is set, if so, use the Dockerfile.buildx as template +# Check if DOCKER_BUILDKIT is set, if so, use the Dockerfile.buildkit as template if [[ -n "${DOCKER_BUILDKIT}" ]]; then - buildx_suffix=.buildx + buildkit_suffix=.buildkit fi set -ex @@ -45,6 +45,6 @@ for arch in "${arches[@]}"; do docker build \ "${LABEL_ARGS[@]}" \ -t "${DOCKER_REPO}:${DOCKER_TAG}-${arch}" \ - -f docker/${arch}/Dockerfile${buildx_suffix}${distro_suffix} \ + -f docker/${arch}/Dockerfile${buildkit_suffix}${distro_suffix} \ . done