Skip to content

Commit 733d594

Browse files
committed
Update Dockerfile for multi-arch build
1 parent 2463a84 commit 733d594

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM golang:1-bookworm as builder
1+
FROM --platform=$BUILDPLATFORM golang:1-bookworm as builder
22

33
# Install GoReleaser
4-
RUN wget --no-verbose https://github.com/goreleaser/goreleaser/releases/download/v1.26.2/goreleaser_1.26.2_amd64.deb
5-
RUN dpkg -i goreleaser_1.26.2_amd64.deb
4+
ARG BUILDARCH TARGETOS TARGETARCH
5+
RUN wget --no-verbose "https://github.com/goreleaser/goreleaser/releases/download/v1.26.2/goreleaser_1.26.2_$BUILDARCH.deb"
6+
RUN dpkg -i "goreleaser_1.26.2_$BUILDARCH.deb"
67

78
# Create and change to the app directory.
89
WORKDIR /app
@@ -19,7 +20,7 @@ COPY . ./
1920
# RUN git lfs pull && ls -alh publications
2021

2122
# Run goreleaser
22-
RUN goreleaser build --single-target --id rwp --skip=validate --snapshot
23+
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH goreleaser build --single-target --id rwp --skip=validate --snapshot --output ./rwp
2324

2425
# Run tests
2526
# FROM builder AS tester
@@ -40,7 +41,7 @@ ADD https://readium-playground-files.storage.googleapis.com/demo/moby-dick.epub
4041
ADD https://readium-playground-files.storage.googleapis.com/demo/BellaOriginal3.epub /srv/publications/
4142

4243
# Copy built Go binary
43-
COPY --from=builder /app/dist/rwp_linux_amd64_v3/rwp /opt/
44+
COPY --from=builder "/app/rwp" /opt/
4445

4546
EXPOSE 15080
4647

0 commit comments

Comments
 (0)