Run container as jovyan instead of nobody.

Contribution (c) Copyright IBM Corp. 2016
This commit is contained in:
Michael Poplavski
2016-01-12 09:27:38 -06:00
parent 943e376fc7
commit b89f25d200

View File

@@ -9,10 +9,9 @@ USER root
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -yq --no-install-recommends \
wget \
build-essential \
python3-dev \
build-essential \
python3-pip \
libsm6 \
python3-zmq \
&& 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 && \
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
RUN pip3 install jupyter_kernel_gateway==0.2.0
@@ -32,5 +39,5 @@ WORKDIR /tmp
ENTRYPOINT ["tini", "--", "jupyter", "kernelgateway"]
CMD ["--KernelGatewayApp.ip=0.0.0.0"]
#error Permission denied: '/nonexistent' when not running as root or as user nobody
USER root
# Run container as jovyan
USER jovyan