This image is published as oryd/xgoreleaser. It's tag (e.g. 1.13.5) reflects the Golang version used. This is a fork of docker/golang-cross. Alternatives include:
First, check the versions for:
The use
this workflow
to build and publish the image. Do not use v
prefixes in the version!
# Include the base config
includes:
- from_url:
url: https://raw.githubusercontent.com/ory/xgoreleaser/master/build.tmpl.yml
variables:
# The name of the brew tap formula:
#
# brew install ory/tap/<brew_name>
brew_name: cli
# The description of the brew formula:
brew_description: ""
# The variable where we store the build's git hash
buildinfo_hash: "github.com/ory/cli/buildinfo.GitHash"
# The variable where we store the build's version
buildinfo_tag: "github.com/ory/cli/buildinfo.Version"
# The variable where we store the build's time
buildinfo_date: "github.com/ory/cli/buildinfo.Time"
# The name of the project (e.g. kratos, ory, ...). Used
# to name the binary, docker images, etc.
project_name: ory
To build this image, run locally:
# Enable Docker experimental features and buildx
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx create --use
go_version=1.17.5
goreleaser_version=1.1.0
docker buildx build \
--load \
--build-arg GO_VERSION=${go_version} --build-arg GORELEASER_VERSION=${goreleaser_version} \
--platform linux/amd64 \
-t oryd/xgoreleaser:${go_version}-${goreleaser_version} \
-t oryd/xgoreleaser:latest \
.
To build this image using the CI, create a new release with the desired Golang version.
You can test a build using
docker pull --platform linux/amd64 oryd/xgoreleaser:latest
docker run --mount type=bind,source="$(pwd)",target=/project \
--platform linux/amd64 \
-e GORELEASER_KEY=$GORELEASER_KEY \
-v /var/run/docker.sock:/var/run/docker.sock \
oryd/xgoreleaser:latest --skip-publish --snapshot --rm-dist
or exec into the container:
docker run --mount type=bind,source="$(pwd)",target=/project \
--platform linux/amd64 \
-e GORELEASER_KEY=$GORELEASER_KEY \
-v /var/run/docker.sock:/var/run/docker.sock \
--entrypoint /bin/bash -it oryd/xgoreleaser:latest
Go tends to remove support for older macOS SDKs which requires re-packaging and uploading the macOS SDK to Google Cloud. To learn how to package it, check out this guide. Next, upload the generated file and mark it public in this Google Cloud Storage Bucket.
The build template is ingested by all projects (e.g. Ory Kratos) and modified slightly to fit the needs of the project.