Merge pull request 'support jupyter lab build in alpine linux' (#1) from readmin/Docker-Jupyter:master into master
Reviewed-on: https://americas.asia:3780/Starlight_0208/Docker-Jupyter/pulls/1
This commit is contained in:
commit
11e80fe54b
23
Jupyter Lab/Alpine-NonRoot/Dockerfile
Normal file
23
Jupyter Lab/Alpine-NonRoot/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
FROM python:3-alpine
|
||||||
|
|
||||||
|
LABEL maintainer="<author>"
|
||||||
|
LABEL version="selfbuilt"
|
||||||
|
|
||||||
|
WORKDIR /jupyter
|
||||||
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
||||||
|
apk add --no-cache libc-dev libffi-dev gcc sudo && \
|
||||||
|
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab --no-cache-dir && \
|
||||||
|
apk del libc-dev libffi-dev gcc
|
||||||
|
RUN \
|
||||||
|
addgroup notebook &&\
|
||||||
|
adduser -Ss /bin/bash -g notebook notebook &&\
|
||||||
|
echo "notebook ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
||||||
|
echo "notebook:123456" | chpasswd &&\
|
||||||
|
chown -R notebook:notebook . &&\
|
||||||
|
mkdir /data &&\
|
||||||
|
chown -R notebook:notebook /data
|
||||||
|
|
||||||
|
EXPOSE 8888
|
||||||
|
USER notebook
|
||||||
|
CMD ["jupyter", "lab", "--no-browser", "--ip", "\"0.0.0.0\"", "--port", "8888", "--allow-root"]
|
||||||
@ -8,8 +8,9 @@ RUN cp /etc/apt/sources.list /etc/apt/sources.list.ori && \
|
|||||||
groupadd notebook &&\
|
groupadd notebook &&\
|
||||||
useradd -m -s /bin/bash -G notebook notebooks &&\
|
useradd -m -s /bin/bash -G notebook notebooks &&\
|
||||||
usermod -aG sudo notebooks &&\
|
usermod -aG sudo notebooks &&\
|
||||||
|
echo 'notebooks:123456' | chpasswd &&\
|
||||||
chown -R notebooks:notebook /jupyter
|
chown -R notebooks:notebook /jupyter
|
||||||
RUN apt update && apt install -y python3 python3-pip
|
RUN apt update && apt install -y python3 python3-pip sudo
|
||||||
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab
|
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab
|
||||||
|
|
||||||
EXPOSE 8888
|
EXPOSE 8888
|
||||||
3
README
3
README
@ -13,7 +13,8 @@ docker run -itd --name jupyter -p 8888:8888 -v /path/to/save:/jupyter <author>/j
|
|||||||
Version
|
Version
|
||||||
------
|
------
|
||||||
Jupyter Lab:
|
Jupyter Lab:
|
||||||
- / : Jupyter Lab servers built on Ubuntu, run as non-root users.
|
- /Alpine-NonRoot : Jupyter Lab server built on Alpine Linux, running with non-root users (`notebook`), this build is relatively secure.
|
||||||
|
- /Ubuntu2204-NonRoot : Jupyter Lab server built on Ubuntu 22.04, running with non-root users (`notebook`), this build is relatively secure.
|
||||||
Jupyter Notebook:
|
Jupyter Notebook:
|
||||||
- /Alpine-NonRoot : Jupyter Notebook server built on Alpine Linux, running with non-root users (`notebook`), this build is relatively secure.
|
- /Alpine-NonRoot : Jupyter Notebook server built on Alpine Linux, running with non-root users (`notebook`), this build is relatively secure.
|
||||||
- /Alpine-Root : Jupyter Notebook server built on Alpine Linux, running as Root user, this build is recommended only for testing or learning environments deployed on an Intranet.
|
- /Alpine-Root : Jupyter Notebook server built on Alpine Linux, running as Root user, this build is recommended only for testing or learning environments deployed on an Intranet.
|
||||||
Loading…
x
Reference in New Issue
Block a user