Skip to content

Commit 7bc6a02

Browse files
jtybergJustin Tyberg
authored andcommitted
Merge pull request #18 from moisei/install-docker-on-container
install docker on jupyterhub container
2 parents 76aa995 + dff2a90 commit 7bc6a02

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Dockerfile.jupyterhub

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ RUN /opt/conda/bin/pip install \
88
oauthenticator==0.4.* \
99
dockerspawner==0.4.*
1010

11+
# install docker on the jupyterhub container
12+
RUN wget https://get.docker.com -q -O /tmp/getdocker && \
13+
chmod +x /tmp/getdocker && \
14+
sh /tmp/getdocker
15+
1116
# Copy TLS certificate and key
1217
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
1318
ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ self-signed-cert:
1212
# make a self-signed cert
1313

1414
secrets/jupyterhub.crt:
15-
@echo "Need an SSL certificate in secrets/jupyterhub.crt"
16-
@exit 1
15+
@if [ "${SECRETS_VOLUME}" = "" ]; then \
16+
echo "Need an SSL certificate in secrets/jupyterhub.crt"; \
17+
exit 1; \
18+
fi
1719

1820
secrets/jupyterhub.key:
19-
@echo "Need an SSL key in secrets/jupyterhub.key"
20-
@exit 1
21+
@if [ "${SECRETS_VOLUME}" = "" ]; then \
22+
echo "Need an SSL key in secrets/jupyterhub.key"; \
23+
exit 1; \
24+
fi
2125

2226
userlist:
2327
@echo "Add usernames, one per line, to ./userlist, such as:"
@@ -26,7 +30,6 @@ userlist:
2630
@exit 1
2731

2832
check-files: secrets/jupyterhub.crt secrets/jupyterhub.key userlist
29-
# fail in an informative way if files don't exist
3033

3134
pull:
3235
docker pull $(DOCKER_NOTEBOOK_IMAGE)

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ services:
1212
image: jupyterhub
1313
container_name: jupyterhub
1414
volumes:
15-
# Bind Docker binary from host machine so we can invoke Docker commands
16-
# from inside container
17-
- "/usr/local/bin/docker:/usr/local/bin/docker:ro"
1815
# Bind Docker socket on the host so we can connect to the daemon from
1916
# within the container
2017
- "/var/run/docker.sock:/var/run/docker.sock:rw"

0 commit comments

Comments
 (0)