Skip to content

Commit

Permalink
Target OS
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Oct 5, 2024
1 parent c05e108 commit 62c6439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ jobs:
# env.no_proxy=168.63.129.16/32
with:
endpoint: tcp://88.99.211.150:2375
# endpoint: ssh://88.99.211.150:2222
- name: Build Capacitor image
id: build
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.multistage
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64 #,linux/arm64/v8
push: false
tags: |
ghcr.io/gimlet-io/capacitor:build
Expand Down
7 changes: 2 additions & 5 deletions docker/Dockerfile.multistage
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /go/src/github.com/gimlet-io/capacitor
COPY . .

RUN mkdir -p bin
RUN GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/linux/amd64/capacitor github.com/gimlet-io/capacitor/cmd/capacitor
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -installsuffix cgo -o bin/$TARGETOS/$TARGETARCH/capacitor github.com/gimlet-io/capacitor/cmd/capacitor

FROM node:22-alpine AS npmbuild

Expand All @@ -26,10 +26,7 @@ RUN mkdir /var/lib/capacitor
RUN chown capacitor:capacitor /var/lib/capacitor
WORKDIR /capacitor

ARG TARGETPLATFORM
ARG BUILDPLATFORM

COPY --from=gobuild --chown=capacitor:capacitor /go/src/github.com/gimlet-io/capacitor/bin/linux/amd64/capacitor capacitor
COPY --from=gobuild --chown=capacitor:capacitor /go/src/github.com/gimlet-io/capacitor/bin/$TARGETOS/$TARGETARCH/capacitor capacitor

Check warning on line 29 in docker/Dockerfile.multistage

View workflow job for this annotation

GitHub Actions / 🤞 Test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$TARGETOS' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 29 in docker/Dockerfile.multistage

View workflow job for this annotation

GitHub Actions / 🤞 Test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$TARGETARCH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
COPY --from=npmbuild --chown=capacitor:capacitor /src/build ./web/build/

USER capacitor
Expand Down

0 comments on commit 62c6439

Please sign in to comment.