mirror of https://github.com/go-gost/gost.git
update Dockerfile
parent
a7037a27bf
commit
48b0a690c5
|
|
@ -59,13 +59,13 @@ jobs:
|
|||
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Buildx and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: ${{ steps.prepare.outputs.docker_platforms }}
|
||||
push: true
|
||||
|
|
|
|||
23
Dockerfile
23
Dockerfile
|
|
@ -1,27 +1,24 @@
|
|||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0 AS xx
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS builder
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
COPY --from=xx / /
|
||||
|
||||
# RUN apk add --no-cache musl-dev git gcc
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
RUN xx-info env
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
RUN go env
|
||||
ENV XX_VERIFY_STATIC=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cache the download before continuing
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
WORKDIR /app/cmd/gost
|
||||
|
||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
|
||||
go build
|
||||
RUN cd cmd/gost && \
|
||||
xx-go build && \
|
||||
xx-verify gost
|
||||
|
||||
FROM alpine:3.20
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue