Compare commits
2 Commits
cd457d4e88
...
b6187bdf85
| Author | SHA1 | Date | |
|---|---|---|---|
| b6187bdf85 | |||
| b1a5538799 |
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.87-bookworm AS builder
|
FROM rust:1.88-bookworm AS builder
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
FROM rust:1.87-bookworm AS builder
|
FROM rust:1.88-bookworm AS builder
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
|||||||
@ -18,18 +18,24 @@ should_push() {
|
|||||||
build_with_buildx() {
|
build_with_buildx() {
|
||||||
local dockerfile=$1
|
local dockerfile=$1
|
||||||
local image=$2
|
local image=$2
|
||||||
|
local platform_args=()
|
||||||
|
|
||||||
if should_push; then
|
if should_push; then
|
||||||
|
platform_args=(--platform "${PLATFORMS}")
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "${PLATFORMS}" \
|
"${platform_args[@]}" \
|
||||||
-f "${dockerfile}" \
|
-f "${dockerfile}" \
|
||||||
-t "${image}:${IMAGE_TAG}" \
|
-t "${image}:${IMAGE_TAG}" \
|
||||||
-t "${image}:latest" \
|
-t "${image}:latest" \
|
||||||
--push \
|
--push \
|
||||||
"${ROOT_DIR}"
|
"${ROOT_DIR}"
|
||||||
else
|
else
|
||||||
|
# buildx cannot `--load` a manifest list, so load the host platform only.
|
||||||
|
local host_platform
|
||||||
|
host_platform="$(docker version --format '{{.Server.Os}}/{{.Server.Arch}}' 2>/dev/null || echo linux/amd64)"
|
||||||
|
platform_args=(--platform "${host_platform}")
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "${PLATFORMS}" \
|
"${platform_args[@]}" \
|
||||||
-f "${dockerfile}" \
|
-f "${dockerfile}" \
|
||||||
-t "${image}:${IMAGE_TAG}" \
|
-t "${image}:${IMAGE_TAG}" \
|
||||||
-t "${image}:latest" \
|
-t "${image}:latest" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user