Skip to content

Commit 0d470f7

Browse files
committed
build(docker): update container configuration for custom user
- Change base image source to quay.io - Update user configuration from jovyan to chiqors - Add environment variables for user permissions - Move git config to user scope
1 parent da5c650 commit 0d470f7

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
ARG JUPYTER_IMAGE_VERSION
2-
FROM jupyter/base-notebook:$JUPYTER_IMAGE_VERSION
2+
FROM quay.io/jupyter/base-notebook:$JUPYTER_IMAGE_VERSION
33

44
USER root
55

66
# Install git
77
RUN apt-get update && \
88
apt-get install -y git && \
9-
git config --system credential.helper 'store --file ~/.git-credentials' && \
109
rm -rf /var/lib/apt/lists/*
1110

12-
RUN echo "jovyan ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jovyan-sudo && \
13-
chmod 0440 /etc/sudoers.d/jovyan-sudo
14-
USER jovyan
11+
USER ${NB_USER}
12+
13+
# Git Config
14+
RUN git config --global credential.helper 'store --file ~/.git-credentials'
1515

1616
# Install extensions
1717
COPY requirements.txt /tmp/

docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ services:
44
context: .
55
args:
66
JUPYTER_IMAGE_VERSION: latest
7+
user: root
78
ports:
89
- "8888:8888"
910
volumes:
10-
- jupyterlab-user-data:/home/jovyan
11+
- jupyterlab-user-data:/home/chiqors
1112
environment:
12-
- JUPYTER_ENABLE_LAB=yes
13+
- NB_USER=chiqors
14+
- CHOWN_HOME=yes
15+
- GRANT_SUDO=yes
1316

1417
volumes:
1518
jupyterlab-user-data:

0 commit comments

Comments
 (0)