Browse Source
Rename `.buildx` Dockerfiles to `.buildkit`
This is a more accurate name, since these Dockerfiles require BuildKit, not Buildx.
pull/3170/head
Jeremy Lin
2 years ago
Failed to extract signature
12 changed files with
10 additions and
7 deletions
-
.github/workflows/release.yml
-
docker/Dockerfile.j2
-
docker/Makefile
-
docker/amd64/Dockerfile.buildkit
-
docker/amd64/Dockerfile.buildkit.alpine
-
docker/arm64/Dockerfile.buildkit
-
docker/arm64/Dockerfile.buildkit.alpine
-
docker/armv6/Dockerfile.buildkit
-
docker/armv6/Dockerfile.buildkit.alpine
-
docker/armv7/Dockerfile.buildkit
-
docker/armv7/Dockerfile.buildkit.alpine
-
hooks/build
|
@ -48,7 +48,10 @@ jobs: |
|
|
ports: |
|
|
ports: |
|
|
- 5000:5000 |
|
|
- 5000:5000 |
|
|
env: |
|
|
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/<user>/<repo>' |
|
|
# DOCKER_REPO/secrets.DOCKERHUB_REPO needs to be 'index.docker.io/<user>/<repo>' |
|
|
DOCKER_REPO: ${{ secrets.DOCKERHUB_REPO }} |
|
|
DOCKER_REPO: ${{ secrets.DOCKERHUB_REPO }} |
|
|
SOURCE_COMMIT: ${{ github.sha }} |
|
|
SOURCE_COMMIT: ${{ github.sha }} |
|
|
|
@ -50,7 +50,7 @@ |
|
|
{% else %} |
|
|
{% else %} |
|
|
{% set package_arch_target_param = "" %} |
|
|
{% set package_arch_target_param = "" %} |
|
|
{% endif %} |
|
|
{% 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 " %} |
|
|
{% set mount_rust_cache = "--mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry " %} |
|
|
{% else %} |
|
|
{% else %} |
|
|
{% set mount_rust_cache = "" %} |
|
|
{% set mount_rust_cache = "" %} |
|
|
|
@ -8,8 +8,8 @@ all: $(OBJECTS) |
|
|
%/Dockerfile.alpine: Dockerfile.j2 render_template |
|
|
%/Dockerfile.alpine: Dockerfile.j2 render_template |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
|
|
|
|
|
|
%/Dockerfile.buildx: Dockerfile.j2 render_template |
|
|
%/Dockerfile.buildkit: Dockerfile.j2 render_template |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
|
|
|
|
|
|
%/Dockerfile.buildx.alpine: Dockerfile.j2 render_template |
|
|
%/Dockerfile.buildkit.alpine: Dockerfile.j2 render_template |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
./render_template "$<" "{\"target_file\":\"$@\"}" > "$@" |
|
|
|
@ -34,9 +34,9 @@ for label in "${LABELS[@]}"; do |
|
|
LABEL_ARGS+=(--label "${label}") |
|
|
LABEL_ARGS+=(--label "${label}") |
|
|
done |
|
|
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 |
|
|
if [[ -n "${DOCKER_BUILDKIT}" ]]; then |
|
|
buildx_suffix=.buildx |
|
|
buildkit_suffix=.buildkit |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
set -ex |
|
|
set -ex |
|
@ -45,6 +45,6 @@ for arch in "${arches[@]}"; do |
|
|
docker build \ |
|
|
docker build \ |
|
|
"${LABEL_ARGS[@]}" \ |
|
|
"${LABEL_ARGS[@]}" \ |
|
|
-t "${DOCKER_REPO}:${DOCKER_TAG}-${arch}" \ |
|
|
-t "${DOCKER_REPO}:${DOCKER_TAG}-${arch}" \ |
|
|
-f docker/${arch}/Dockerfile${buildx_suffix}${distro_suffix} \ |
|
|
-f docker/${arch}/Dockerfile${buildkit_suffix}${distro_suffix} \ |
|
|
. |
|
|
. |
|
|
done |
|
|
done |
|
|