This commit is contained in:
spiritsoul
2024-08-14 13:09:59 +08:00
parent 1bca0052c5
commit 3bb70191e7
2 changed files with 6 additions and 20 deletions

View File

@@ -29,6 +29,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/mips,linux/mipsle,linux/s390x,linux/riscv64
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/s390x,linux/riscv64
# linux/mips,linux/mipsle 暂无alpine镜像
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/goecs:latest

View File

@@ -1,24 +1,9 @@
# syntax=docker/dockerfile:1
# 为支持的平台使用 Alpine
FROM --platform=$BUILDPLATFORM alpine:latest AS base-alpine
FROM alpine:latest
# 为 MIPS 平台使用替代基础镜像
FROM --platform=linux/mips debian:stable-slim AS base-mips
FROM --platform=linux/mipsle debian:stable-slim AS base-mipsle
# 选择适当的基础镜像
FROM base-$TARGETARCH$TARGETVARIANT AS final
# 安装必要的工具(需要根据基础镜像调整)
RUN if [ -f /etc/alpine-release ]; then \
apk add --no-cache wget curl bash; \
else \
apt-get update && apt-get install -y wget curl bash; \
fi
# 设置 GitHub URL 环境变量
ENV GITHUB_URL="https://github.com/oneclickvirt/ecs/releases/latest"
# 安装必要的工具
RUN apk add --no-cache wget curl bash
# 下载并执行 goecs.sh 脚本
RUN curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && \
@@ -27,4 +12,4 @@ RUN curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -
bash goecs.sh install
# 设置 goecs 为入口点
ENTRYPOINT ["goecs"]
ENTRYPOINT ["goecs"]