-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and publish multi-arch docker images on tag (#323)
* remove now-unused docker orb * update Go to 1.16 + go.mod to 1.16 + Circle cimg/go to 1.16 * new docker image build script + set BuildID ldflags + use ko to perform the multi-arch image build *and* publish * new docker_publish job + runs the new image build script + setup_remote_docker so a docker service is available during the job + caches the ko installation + runs on all build workflow executions - if running on a tag, publishes to Docker Hub - all other builds, publishes to local docker registry Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
- Loading branch information
1 parent
76b9477
commit 7b1c8f7
Showing
3 changed files
with
49 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set -o nounset | ||
set -o pipefail | ||
set -o xtrace | ||
|
||
TAGS="latest" | ||
VERSION=${CIRCLE_TAG:-dev} | ||
REPO=${KO_DOCKER_REPO:-ko.local} | ||
if [[ $VERSION != "dev" ]]; then | ||
# set docker username and add version tag | ||
REPO="honeycombio" | ||
TAGS+=",$VERSION" | ||
fi | ||
|
||
unset GOOS | ||
unset GOARCH | ||
export KO_DOCKER_REPO=$REPO | ||
export GOFLAGS="-ldflags=-X=main.BuildID=$VERSION" | ||
export SOURCE_DATE_EPOCH=$(date +%s) | ||
# shellcheck disable=SC2086 | ||
ko publish \ | ||
--tags "${TAGS}" \ | ||
--base-import-paths \ | ||
--platform "linux/amd64,linux/arm64" \ | ||
./cmd/refinery |
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,6 +1,6 @@ | ||
module github.com/honeycombio/refinery | ||
|
||
go 1.14 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 | ||
|