-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
38 lines (34 loc) · 1.24 KB
/
cloudbuild.yaml
File metadata and controls
38 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
steps:
# Setup Docker buildx for multi-arch builds
- name: 'gcr.io/cloud-builders/docker'
id: 'setup-buildx'
entrypoint: 'bash'
args:
- '-c'
- |
# Install QEMU for cross-platform builds
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# Create a buildx builder
docker buildx create --name multiarch-builder --use
docker buildx inspect --bootstrap
# Build multi-arch image using buildx
- name: 'gcr.io/cloud-builders/docker'
id: 'build-multiarch'
entrypoint: 'bash'
args:
- '-c'
- |
# Build and push multi-arch image using the Dockerfile.multiarch
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag us-docker.pkg.dev/u2i-bootstrap/docker-images/compliance-cli-builder:latest \
--tag us-docker.pkg.dev/u2i-bootstrap/docker-images/compliance-cli-builder:$BUILD_ID \
--tag us-docker.pkg.dev/u2i-bootstrap/docker-images/compliance-cli-builder:${_BUILD_TAG} \
--push \
-f Dockerfile.multiarch \
.
options:
logging: CLOUD_LOGGING_ONLY
machineType: 'E2_HIGHCPU_8'
substitutions:
_BUILD_TAG: ${BUILD_ID} # Default to BUILD_ID if not provided