Binary-Output-Path since GOAMD64 #3166
-
|
Hi all, I have a question regarding the latest Go 1.18 This has changed the output path of the compiled binary from e.g. Is there a solution to access the files from the Dockerfile without splitting them to amd64 and non-amd64? Note: The reason not to build the images with goreleaser too is the missing buildx-support. Thanks a lot! 🥳 My config files for goreleaser and the Github Action which builds the image: .goreleaser project_name: my-project
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarm:
- "6"
- "7"
ignore:
- goos: linux
goarch: "386"
ldflags:
- -s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.Date={{.CommitDate}} -X main.BuiltBy=goreleaser
mod_timestamp: "{{.CommitTimestamp}}"
flags:
- -trimpath
sboms:
- artifacts: archive
args: ["$artifact", "--file", "$document", "--output", "json"]
snapshot:
name_template: "{{ .Version }}"
release:
disable: true
changelog:
skip: true
source:
enabled: true
signs:
- cmd: cosign
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: all
output: trueDockerfile FROM scratch
ARG TARGETOS
ARG TARGETARCH
COPY dist/my-project_${TARGETOS}_${TARGETARCH}/my-project /usr/local/bin/my-project
ENTRYPOINT ["/usr/local/bin/my-project"]
Github Workflow ...
- name: Build image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/ckotzbauer/my-project:latest |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
doesn't works? |
Beta Was this translation helpful? Give feedback.
-
|
Another approach would be to parse |
Beta Was this translation helpful? Give feedback.
doesn't
works?