mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
feat: add multiplatform docker image build (#18)
The build is very slow for some reason. ~15mins
This commit is contained in:
7
.github/workflows/docker.yaml
vendored
7
.github/workflows/docker.yaml
vendored
@@ -33,13 +33,15 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
version: latest
|
||||
buildkitd-flags: --debug
|
||||
-
|
||||
name: Login to ghcr.io
|
||||
uses: docker/login-action@v1
|
||||
@@ -61,6 +63,5 @@ jobs:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -1,11 +1,14 @@
|
||||
FROM golang:1.17-alpine AS build
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
ENV PORT 10000
|
||||
|
||||
COPY . /go/src/ondemand-service
|
||||
WORKDIR /go/src/ondemand-service
|
||||
|
||||
RUN go build -o /go/bin/ondemand-service
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go/bin/ondemand-service
|
||||
|
||||
FROM alpine
|
||||
EXPOSE 10000
|
||||
|
||||
Reference in New Issue
Block a user