mirror of
https://github.com/coaidev/coai.git
synced 2025-05-19 04:50:14 +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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
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
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Build and push Docker images
|
- name: Build and push Docker images
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: programzmh/chatnio:latest
|
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
|
# License: Apache-2.0
|
||||||
# Description: Dockerfile for chatnio
|
# Description: Dockerfile for chatnio
|
||||||
|
|
||||||
FROM golang:1.20-alpine AS backend
|
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS backend
|
||||||
|
|
||||||
WORKDIR /backend
|
WORKDIR /backend
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Set go proxy to https://goproxy.cn (open for vps in China Mainland)
|
# Set go proxy to https://goproxy.cn (open for vps in China Mainland)
|
||||||
# RUN go env -w GOPROXY=https://goproxy.cn,direct
|
# 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
|
# Install dependencies for cgo
|
||||||
RUN apk add --no-cache gcc musl-dev
|
RUN apk add --no-cache gcc musl-dev
|
||||||
|
Loading…
Reference in New Issue
Block a user