add ARG to control mirror_site(For I18N)

This commit is contained in:
ben0i0d 2024-10-31 17:20:01 +08:00
parent 182afb9b5f
commit f28efc633d
6 changed files with 30 additions and 12 deletions

View File

@ -12,7 +12,10 @@ jobs:
uses: https://eoelab.org:1027/actions/build-push-action@v6
with:
context: python
build-args: BASE_IMAGE=debian:bookworm-slim
build-args: |
BASE_IMAGE=debian:bookworm-slim
DEBIAN_MIRROR=mirrors.ustc.edu.cn
PYPI_MIRROR=https://mirrors.bfsu.edu.cn/pypi/web/simple
tags: eoelab.org:1027/${{ gitea.repository }}:py-c
SCIPY:
@ -236,6 +239,7 @@ jobs:
uses: https://eoelab.org:1027/actions/build-push-action@v6
with:
context: Program/julia
build-args: JULIA_MIRROR=https://mirrors.cernet.edu.cn/julia
tags: eoelab.org:1027/${{ gitea.repository }}:julia
KOTLIN:
@ -273,6 +277,7 @@ jobs:
uses: https://eoelab.org:1027/actions/build-push-action@v6
with:
context: Program/r
build-args: CRAN_MIRROR="USTC='https://mirrors.ustc.edu.cn/CRAN/'"
tags: eoelab.org:1027/${{ gitea.repository }}:r
NOVNC:

View File

@ -8,9 +8,11 @@ RUN apt-get update --yes && apt-get install --yes --no-install-recommends gnupg
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
ARG JULIA_MIRROR
COPY --chown="${NB_UID}:${NB_GID}" --from=builder /opt/julias/ /opt/julias/
ENV JULIA_PKG_SERVER=https://mirrors.cernet.edu.cn/julia \
ENV JULIA_PKG_SERVER=${JULIA_MIRROR} \
JULIA_NUM_THREADS=8 \
JUPYTER_DATA_DIR=/opt/base/share/jupyter \
JULIA_DEPOT_PATH=/opt/julia \

View File

@ -1,11 +1,13 @@
FROM eoelab.org:1027/ben0i0d/jupyter:py-c
ARG CRAN_MIRROR
USER root
# INSTALL R+IRkernel
RUN apt-get update && apt-get install --yes --no-install-recommends r-base r-cran-irkernel && apt-get clean && rm -rf /var/lib/apt/lists/* && \
# set cran mirror
echo 'options(repos=c(USTC="https://mirrors.ustc.edu.cn/CRAN/"))' >> /usr/lib/R/library/base/R/Rprofile && \
# set cran mirror
echo "options(repos=c(${CRAN_MIRROR}))" >> /usr/lib/R/library/base/R/Rprofile && \
R -e 'IRkernel::installspec(sys_prefix = TRUE);q()' && \
chown -hR "${NB_USER}:${NB_GID}" "${HOME}"

View File

@ -7,6 +7,7 @@ English | [中文](README_CN.md)
**THIS doc for non-CN USER**
**dockerhub: https://hub.docker.com/r/ben0i0d/jupyter**
**Our Gitea: https://eoelab.org:1027/ben0i0d/jupyter**
### HOW TO USE
@ -123,13 +124,15 @@ M-->MF(Scilab)
* Mathematica 14.0
* Maple 2023
**Mirror source**
**Default Mirror source**
* pip bfsuhttps://mirrors.bfsu.edu.cn/help/pypi/
* apt ustchttps://mirrors.ustc.edu.cn/help/debian.html
* apache ustc: https://mirrors.ustc.edu.cn/apache/
* julia-pkg ustc: https://mirrors.ustc.edu.cn/julia/
* julia-pkg mirrorz: https://mirrors.cernet.edu.cn/julia
* CRAN ustchttps://mirrors.ustc.edu.cn/CRAN/
***Now You can use ARG control which site you want***
### Upstream of the project
https://github.com/jupyter/docker-stacks

View File

@ -7,6 +7,7 @@ English | [中文](README_CN.md)
**为中国用户的文档**
**我们的docker镜像仓库是 https://hub.docker.com/r/ben0i0d/jupyter**
**我们的Gitea镜像仓库是 https://eoelab.org:1027/ben0i0d/jupyter**
### 如何使用
@ -45,7 +46,7 @@ plt.rcParams["font.family"] = zh_font.get_name()
* 说明
1. 上游已经切换到`debian:bookworm-slim`
2. 添加了sudo的无密码使用在安全要求较高的场景中不要允许特权提升
3. 提供软件包:.zip文件解压(.zip)
3. 提供软件包:.zip文件解压
* Python支持Python。
* Scipy提供Python的科学计算环境
* Scrpy: 提供Python的网页采取环境适用于数据挖掘、网络爬虫
@ -130,13 +131,15 @@ M-->MF(Scilab)
* Mathematica 13.3.1
* Maple 2023
**镜像源**
**默认镜像源**
* pip bfsuhttps://mirrors.bfsu.edu.cn/help/pypi/
* apt ustchttps://mirrors.ustc.edu.cn/help/debian.html
* apache ustc: https://mirrors.ustc.edu.cn/apache/
* julia-pkg ustc: https://mirrors.ustc.edu.cn/julia/
* julia-pkg mirrorz: https://mirrors.cernet.edu.cn/julia
* CRAN ustchttps://mirrors.ustc.edu.cn/CRAN/
***现在你可以通过ARG选择你需要的镜像站点***
### 项目上游
jupyter团队项目 https://github.com/jupyter/docker-stacks

View File

@ -1,6 +1,9 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
FROM debian:bookworm-slim
ARG PYPI_MIRROR
ARG DEBIAN_MIRROR
EXPOSE 8888
@ -22,7 +25,7 @@ COPY jupyter_server_config.py docker_healthcheck.py /etc/jupyter/
# shell profile , to disable PATH be overwrited by jupyter
COPY profile /etc/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
RUN sed -i "s/deb.debian.org/${DEBIAN_MIRROR}/g" /etc/apt/sources.list.d/debian.sources && \
# install base packages
apt-get update --yes && apt-get install --yes --no-install-recommends sudo tini unzip python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
@ -40,7 +43,7 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debi
mkdir /usr/local/bin/start-notebook.d && mkdir /usr/local/bin/before-notebook.d && \
# setup base venv & pip_mirror
mkdir -p "/opt/base/" && python3 -m venv /opt/base && chown -hR "${NB_USER}:${NB_GID}" "/opt/base" && \
echo '[global]\nindex-url = https://mirrors.bfsu.edu.cn/pypi/web/simple' > /etc/pip.conf
echo "[global]\nindex-url = ${PYPI_MIRROR}" > /etc/pip.conf
# HEALTHCHECK documentation: https://docs.docker.com/engine/reference/builder/#healthcheck
# This healtcheck works well for `lab`, `notebook`, `nbclassic`, `server`, and `retro` jupyter commands