Skip to content

Commit

Permalink
Enforce --platform <platform> when calling docker run to ensure t…
Browse files Browse the repository at this point in the history
…he fastest image for the current's user machine is used
  • Loading branch information
maoueh committed Sep 18, 2023
1 parent ec79a0f commit 7dfc1c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.7.2

* Enforce `--platform <platform>` when calling `docker run` to ensure the fastest image for the current's user machine is used.

* Now printing exact image used when performing the release.

## v0.7.1

* Bumped to `Golang` `1.21`, this will pull `goreleaser/goreleaser-cross:v1.21` so expect some delays before your build starts.`
Expand Down
6 changes: 6 additions & 0 deletions cmd/sfreleaser/release_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ func releaseGithub(global *GlobalModel, release *ReleaseModel, githubRelease *Gi
}

func goreleaseDockerCommand(global *GlobalModel, githubRelease *GitHubReleaseModel, command string, dockerExtraArguments []string, goReleaserExtraArguments []string) []string {
platform := "linux/amd64"
if runtime.GOARCH == "arm64" {
platform = "linux/arm64"
}

arguments := []string{
"docker",

"run",
"--platform", platform,
"--rm",
"-e CGO_ENABLED=1",
"--env-file", githubRelease.EnvFilePath,
Expand Down

0 comments on commit 7dfc1c2

Please sign in to comment.