Skip to content

Commit

Permalink
linux: Build amd64 and arm64 podman-remote-static binaries
Browse files Browse the repository at this point in the history
Looking at https://github.com/containers/podman/releases/tag/v4.3.1,
it's not explicit which arch the podman-remote-static binary is built
for, so this commit adds an -$(goarch) suffix to it. It builds both
arm64 and amd64 binaries as I need both for crc.

Signed-off-by: Christophe Fergeau <[email protected]>
  • Loading branch information
cfergeau committed Nov 29, 2022
1 parent c49de22 commit d223950
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ $(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR)
-tags "${REMOTETAGS}" \
-o $@ ./cmd/podman

$(SRCBINDIR)/podman-remote-static: $(SRCBINDIR) $(SOURCES) go.mod go.sum
$(SRCBINDIR)/podman-remote-static_amd64 $(SRCBINDIR)/podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_%: $(SRCBINDIR) $(SOURCES) go.mod go.sum
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=$(GOARCH) \
GOARCH=$* \
$(GO) build \
$(BUILDFLAGS) \
$(GO_LDFLAGS) '$(LDFLAGS_PODMAN_STATIC)' \
Expand All @@ -362,8 +362,9 @@ $(SRCBINDIR)/quadlet: $(SOURCES) go.mod go.sum
.PHONY: quadlet
quadlet: bin/quadlet

PHONY: podman-remote-static
podman-remote-static: $(SRCBINDIR)/podman-remote-static
PHONY: podman-remote-static_amd64 podman-remote-static_arm64
podman-remote-static_amd64: $(SRCBINDIR)/podman-remote-static_amd64
podman-remote-static_arm64: $(SRCBINDIR)/podman-remote-static_arm64

.PHONY: podman-winpath
podman-winpath: $(SOURCES) go.mod go.sum
Expand Down
9 changes: 6 additions & 3 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ spelled with complete minutiae.
$ make podman-remote-release-darwin_amd64.zip \
podman-remote-release-darwin_arm64.zip \
podman-remote-release-windows_amd64.zip \
podman-remote-static
podman-remote-static_amd64 \
podman-remote-static_arm64
$ mv podman-* bin/
$ cd bin/
$ tar -cvzf podman-remote-static.tar.gz podman-remote-static
$ tar -cvzf podman-remote-static_amd64.tar.gz podman-remote-static_amd64
$ tar -cvzf podman-remote-static_arm64.tar.gz podman-remote-static_arm64
$ sha256sum *.zip *.tar.gz > shasums
```

Expand All @@ -270,7 +272,8 @@ spelled with complete minutiae.
* podman-remote-release-darwin_arm64.zip
* podman-remote-release-windows_amd64.zip
* podman-vX.Y.Z.msi
* podman-remote-static.tar.gz
* podman-remote-static_amd64.tar.gz
* podman-remote-static_arm64.tar.gz
* shasums
1. Click the Publish button to make the release (or pre-release)
available.
Expand Down
4 changes: 2 additions & 2 deletions contrib/podmanremoteimage/Containerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM registry.access.redhat.com/ubi8/go-toolset:latest AS builder
WORKDIR /opt/app-root/src
COPY . .
RUN make podman-remote-static
RUN make podman-remote-static_amd64
RUN GOOS=windows make podman-remote
RUN GOOS=darwin make podman-remote

FROM scratch
COPY --from=builder /opt/app-root/src/bin .
ENTRYPOINT ["/podman-remote-static"]
ENTRYPOINT ["/podman-remote-static_amd64"]
2 changes: 1 addition & 1 deletion contrib/podmanremoteimage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-

- For Linux binary
```bash
$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static . && podman rm remote-temp
$ podman cp $(podman create --name remote-temp quay.io/containers/podman-remote-artifacts:latest):/podman-remote-static_amd64 . && podman rm remote-temp
```

- For Mac binary
Expand Down

0 comments on commit d223950

Please sign in to comment.