fix: 更新Docker构建脚本
This commit is contained in:
@@ -20,8 +20,10 @@ COPY --from=build-node /web/dist /web
|
||||
COPY --from=build-node /api /api
|
||||
COPY --from=build-node /linux /linux
|
||||
|
||||
# 更换镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
# 安装其他依赖
|
||||
RUN apk add gcc musl-dev libpcap-dev
|
||||
RUN apk update && apk add gcc musl-dev libpcap-dev && rm -rf /var/cache/apk/*
|
||||
|
||||
# 设置变量
|
||||
ENV CGO_ENABLED=1
|
||||
@@ -53,10 +55,11 @@ ENV LANG="en_US.UTF-8"
|
||||
ENV TZ="Asia/Shanghai"
|
||||
WORKDIR /usr/local/etc/omc
|
||||
|
||||
COPY --from=build-golang /linux /
|
||||
COPY --from=build-golang /web /usr/local/etc/omc/web
|
||||
COPY --from=build-golang /linux/lib/systemd/system/* /lib/systemd/system
|
||||
COPY --from=build-golang /linux/usr/local/* /usr/local
|
||||
COPY --from=build-golang /api/omc /usr/local/bin/omc
|
||||
COPY --from=build-golang /api/sshsvc/sshsvc /usr/local/bin/sshsvc
|
||||
COPY --from=build-golang /web /usr/local/etc/omc/web
|
||||
|
||||
EXPOSE 80 443 33030
|
||||
|
||||
@@ -66,3 +69,5 @@ CMD ["/sbin/init"]
|
||||
# docker build --platform linux/amd64 --build-arg VERSION=2.2505.2 -t omc:2.2505.2 .
|
||||
# docker run -it omc:2.2505.2 sh
|
||||
# service ssh start && service nginx start && /usr/local/bin/omc --env prod -c /usr/local/etc/omc/omc.yaml
|
||||
# docker run --rm omc:r1.0.0-docker-ubuntu22.04-amd64 bash
|
||||
# docker run --privileged=true --restart=always -m 512M --name omc_2.2505.2 -d omc:r1.0.0-docker-ubuntu22.04-amd64
|
||||
|
||||
Reference in New Issue
Block a user