-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): adding multi-platform support
- Loading branch information
Showing
3 changed files
with
42 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM debian:12-slim as downloader | ||
FROM debian:12-slim AS downloader | ||
LABEL maintainer="EKGF <[email protected]>" | ||
|
||
ARG TERRAFORM_VERSION="1.9.5" | ||
|
@@ -25,6 +25,9 @@ RUN name="terraform-provider-sops_${TERRAFORM_SOPS_VERSION}" && \ | |
# | ||
FROM gcr.io/cloud-builders/gcloud:latest | ||
LABEL maintainer="EKGF <[email protected]>" | ||
LABEL org.opencontainers.image.source="https://github.com/EKGF/gcloud-terraform" | ||
LABEL org.opencontainers.image.description="Terraform Cloud Builder. This builder can be used to run the terraform tool in the GCE environment." | ||
LABEL org.opencontainers.image.licenses=MIT | ||
|
||
# | ||
# Current user is root with home /root | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
#!/usr/bin/env bash | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" | ||
_IMAGE_NAME="ghcr.io/ekgf/gcloud-terraform" | ||
_IMAGE_VERSION="latest" | ||
_MANUALLY_INCREMENTED_IMAGE_VERSION="0.0.7" | ||
_IMAGE_NAME="$(< IMAGE_NAME)" | ||
_IMAGE_VERSION="$(< VERSION)" | ||
|
||
cd "${SCRIPT_DIR}" || exit 1 | ||
|
||
docker build . \ | ||
# Create a parallel multi-platform builder | ||
docker buildx create --name mybuilder --use | ||
# Make "buildx" the default | ||
docker buildx install | ||
# Build for multiple platforms | ||
docker build \ | ||
--iidfile=.image-id \ | ||
"--tag=${_IMAGE_NAME}:${_IMAGE_VERSION}" \ | ||
"--tag=${_IMAGE_NAME}:${_MANUALLY_INCREMENTED_IMAGE_VERSION}" | ||
--platform linux/amd64,linux/arm64 \ | ||
"--tag=${_IMAGE_NAME}:latest" \ | ||
"--tag=${_IMAGE_NAME}:${_IMAGE_VERSION}" . | ||
exit $? |