Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
twbworld committed Jan 8, 2024
1 parent 0e8d372 commit 9411212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
type: string
platforms:
description: '构建镜像平台'
default: 'linux/amd64'
default: 'linux/amd64,linux/arm64/v8'
required: false
type: string

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ FROM --platform=$TARGETPLATFORM golang:1.21-alpine AS builder
WORKDIR /app
ARG TARGETARCH
ENV GO111MODULE=on
ENV CGO_ENABLED=1
# ENV GOPROXY="https://goproxy.cn,direct"
COPY go.mod go.sum ./
#安装编译需要的环境gcc等, 同时CGO_ENABLED=1
RUN apk add --no-cache build-base --virtual .build-deps ca-certificates gcc g++ && \
RUN apk add --no-cache --virtual .build-deps ca-certificates gcc g++ && \
go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=$TARGETARCH go build -ldflags="-s -w" -installsuffix cgo -o server . && \
Expand Down

0 comments on commit 9411212

Please sign in to comment.