mirror of
https://github.com/coaidev/coai.git
synced 2025-05-18 20:40:13 +09:00
fix: build error
This commit is contained in:
parent
6fb6b6a229
commit
bd7987bb64
20
.github/workflows/docker-ci.yaml
vendored
20
.github/workflows/docker-ci.yaml
vendored
@ -2,31 +2,37 @@ name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: "arm64,amd64"
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: programzmh/chatnio:latest
|
||||
cache-from: type=registry,ref=programzmh/chatnio:buildcache
|
||||
cache-to: type=registry,ref=programzmh/chatnio:buildcache,mode=max
|
||||
|
@ -2,14 +2,16 @@
|
||||
# License: Apache-2.0
|
||||
# Description: Dockerfile for chatnio
|
||||
|
||||
FROM golang:1.20-alpine AS backend
|
||||
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS backend
|
||||
|
||||
WORKDIR /backend
|
||||
COPY . .
|
||||
|
||||
# Set go proxy to https://goproxy.cn (open for vps in China Mainland)
|
||||
# RUN go env -w GOPROXY=https://goproxy.cn,direct
|
||||
ENV GOOS=linux GO111MODULE=on CGO_ENABLED=1
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
ENV GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on CGO_ENABLED=1
|
||||
|
||||
# Install dependencies for cgo
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
|
Loading…
Reference in New Issue
Block a user