1
0

feat: 添加对alpine3.20的支持并更新相关Dockerfile和脚本

This commit is contained in:
TsMask
2025-05-21 16:14:52 +08:00
parent e279b75c49
commit 6e769c468d
6 changed files with 33 additions and 83 deletions

View File

@@ -54,14 +54,13 @@ COPY --from=build-golang /web /usr/local/etc/omc/web
# 更新apt并安装必要工具
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add musl-dev libpcap-dev nginx tzdata && rm -rf /var/cache/apk/*
RUN apk add musl-dev libpcap-dev bash nginx tzdata && rm -rf /var/cache/apk/*
# 设置时区和语言环境
ENV LANG="en_US.UTF-8"
ENV TZ="Asia/Shanghai"
WORKDIR /usr/local/etc/omc
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
RUN chmod +x /usr/local/etc/omc/script/*.sh
RUN /usr/local/etc/omc/script/postunpack.sh
@@ -69,13 +68,17 @@ EXPOSE 80 443 33030 33443 33033 33034 33060
CMD [ "/usr/local/etc/omc/script/entrypoint.sh" ]
# build 546 MB
# docker docker build --platform linux/amd64 --build-arg TARGETARCH=amd64 --build-arg VERSION=2.2505.2 -t omc:r2.2505.2-ubuntu22.04-amd64 .
# build 448MB
# docker docker build --platform linux/amd64 --build-arg TARGETARCH=amd64 --build-arg VERSION=2.2505.2 -t omc:2.2505.2-alpine3.20-amd64 .
# service ssh start && service nginx start && /usr/local/bin/omc --env prod -c /usr/local/etc/omc/omc.yaml
# docker run -it omc:r2.2505.2-ubuntu22.04-amd64 /bin/bash
# docker run --network omcnet -it omc:2.2505.2-alpine3.20-amd64 /bin/bash
# docker run --privileged=true --restart=always -m 512M --name omc_2.2505.2 -d omc:r2.2505.2-ubuntu22.04-amd64
# docker run --privileged=true --restart=always -m 512M \
# -e TZ=Asia/Shanghai \
# -e M_PARAM=lite \
# -p 80:80 \
# -p 443:443 \
# --network omcnet \
# --name omc \
# -d omc:2.2505.2-alpine3.20-amd64
# docker rm -f omc_2.2505.2
# docker run -it omc_2.2505.2 bash