feat: adjust docker image build
This commit is contained in:
+3
-15
@@ -42,27 +42,15 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w
|
|||||||
FROM debian:bookworm-slim
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
ENV CONDA_DIR=/opt/miniforge3
|
|
||||||
ENV PATH=${CONDA_DIR}/bin:$PATH
|
|
||||||
|
|
||||||
RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||||
&& sed -i 's@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
&& sed -i 's@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||||
&& echo "${TZ}" > /etc/timezone \
|
&& echo "${TZ}" > /etc/timezone \
|
||||||
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt install -y tzdata git gcc curl wget vim ca-certificates procps htop e2fsprogs \
|
&& apt install -y tzdata git gcc curl wget vim nodejs npm python3 python3-pip \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& curl -sSL https://gh-proxy.com/https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh -o /tmp/miniforge.sh \
|
&& python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
&& bash /tmp/miniforge.sh -b -p ${CONDA_DIR} \
|
|
||||||
&& rm -f /tmp/miniforge.sh \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda config --set show_channel_urls yes \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda config --set channel_priority strict \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda init \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge \
|
|
||||||
&& "${CONDA_DIR}"/bin/python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
|
|
||||||
&& "${CONDA_DIR}"/bin/conda clean -afy
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& sed -i 's@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||||
|
&& echo "${TZ}" > /etc/timezone \
|
||||||
|
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y tzdata git gcc curl wget vim nodejs npm python3 python3-pip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
Reference in New Issue
Block a user