代码拉取完成,页面将自动刷新
FROM --platform=${BUILDPLATFORM} golang:latest AS builder
RUN echo 'Acquire::http::proxy "http://172.17.0.1:7899";' | tee -a /etc/apt/apt.conf
RUN echo 'Acquire::https::proxy "http://172.17.0.1:7899";' | tee -a /etc/apt/apt.conf
RUN export GO111MODULE=on
RUN export GOPROXY=https://goproxy.cn,direct
RUN apt update \
&& apt upgrade -y \
&& apt install make -y \
&& apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends ca-certificates
WORKDIR /go/src/goodlink
COPY --from=tonistiigi/xx:golang / /
ARG TARGETOS TARGETARCH TARGETVARIANT
RUN echo 111111111111
COPY gogo /go/src/gogo
COPY goodlink2 /go/src/goodlink2
RUN --mount=target=. \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
make clean && \
make linux-amd64 BINDIR= ${TARGETOS}-${TARGETARCH}${TARGETVARIANT} && \
mv /goodlink* /goodlink
COPY upx /usr/bin/
RUN upx --best /goodlink
FROM --platform=${BUILDPLATFORM} scratch
#MAINTAINER 维护者信息
MAINTAINER kony
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /lib/x86_64-linux-gnu /lib/x86_64-linux-gnu
COPY --from=builder /lib64 /lib64
COPY --from=builder /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --from=builder /goodlink /home/
#WORKDIR 相当于cd
WORKDIR /home/
#ENTRYPOINT 运行命令+固定参数
ENTRYPOINT ["./goodlink", "--gogo-restart-delay=2000"]
#CMD 可变参数, 会被docker run带入的参数替换
CMD ["--h"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。