mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 15:32:56 +00:00
Run container as jovyan instead of nobody.
Contribution (c) Copyright IBM Corp. 2016
This commit is contained in:
@@ -9,10 +9,9 @@ USER root
|
|||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
RUN apt-get update && apt-get install -yq --no-install-recommends \
|
RUN apt-get update && apt-get install -yq --no-install-recommends \
|
||||||
wget \
|
wget \
|
||||||
build-essential \
|
|
||||||
python3-dev \
|
python3-dev \
|
||||||
|
build-essential \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
libsm6 \
|
|
||||||
python3-zmq \
|
python3-zmq \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
@@ -22,6 +21,14 @@ RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.6.0/tini &
|
|||||||
mv tini /usr/local/bin/tini && \
|
mv tini /usr/local/bin/tini && \
|
||||||
chmod +x /usr/local/bin/tini
|
chmod +x /usr/local/bin/tini
|
||||||
|
|
||||||
|
# Configure environment
|
||||||
|
ENV SHELL /bin/bash
|
||||||
|
ENV KG_USER jovyan
|
||||||
|
ENV KG_UID 1000
|
||||||
|
|
||||||
|
# Create jovyan user with UID=1000
|
||||||
|
RUN useradd -m -s /bin/bash -N -u $KG_UID $KG_USER
|
||||||
|
|
||||||
# Install Kernel Gateway
|
# Install Kernel Gateway
|
||||||
RUN pip3 install jupyter_kernel_gateway==0.2.0
|
RUN pip3 install jupyter_kernel_gateway==0.2.0
|
||||||
|
|
||||||
@@ -32,5 +39,5 @@ WORKDIR /tmp
|
|||||||
ENTRYPOINT ["tini", "--", "jupyter", "kernelgateway"]
|
ENTRYPOINT ["tini", "--", "jupyter", "kernelgateway"]
|
||||||
CMD ["--KernelGatewayApp.ip=0.0.0.0"]
|
CMD ["--KernelGatewayApp.ip=0.0.0.0"]
|
||||||
|
|
||||||
#error Permission denied: '/nonexistent' when not running as root or as user nobody
|
# Run container as jovyan
|
||||||
USER root
|
USER jovyan
|
Reference in New Issue
Block a user