Skip to content

Commit

Permalink
Merge pull request #9 from jtyberg/unix_sock
Browse files Browse the repository at this point in the history
Connect to Docker daemon on host through Unix socket.
  • Loading branch information
minrk committed May 10, 2016
2 parents aa204d2 + 65c2a7c commit 63f7c4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 3 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ services:
# Bind Docker binary from host machine so we can invoke Docker commands
# from inside container
- "/usr/local/bin/docker:/usr/local/bin/docker:ro"
# Bind Docker TLS certs from host machine so we can authenticate with the
# daemon on the host (DOCKER_HOST should be set to host's IP)
- "/etc/docker:/etc/docker:ro"
# Bind Docker socket on the host so we can connect to the daemon from
# within the container
- "/var/run/docker.sock:/var/run/docker.sock:rw"
# Bind Docker volume on host for JupyterHub database and cookie secrets
- "data:${DATA_VOLUME_CONTAINER}"
ports:
- "443:443"
environment:
# Pass DOCKER_HOST to container to allow it to connect to daemon on host
DOCKER_HOST: ${DOCKER_HOST}
# Locations of TLS certificate and key needed to auth with daemon on host
DOCKER_TLS_CERT: "/etc/docker/server.pem"
DOCKER_TLS_KEY: "/etc/docker/server-key.pem"
# All containers will join this network
DOCKER_NETWORK_NAME: ${DOCKER_NETWORK_NAME}
# JupyterHub will spawn this Notebook image for users
Expand Down
4 changes: 0 additions & 4 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
c.DockerSpawner.extra_create_kwargs.update({ 'volume_driver': 'local' })
# Remove containers once they are stopped
c.DockerSpawner.remove_containers = True
# Specify paths to TLS certificate and key used to authenticate to Docker
# daemon at DOCKER_HOST
c.DockerSpawner.tls_cert = os.environ['DOCKER_TLS_CERT']
c.DockerSpawner.tls_key = os.environ['DOCKER_TLS_KEY']
# For debugging arguments passed to spawned containers
c.DockerSpawner.debug = True

Expand Down

0 comments on commit 63f7c4b

Please sign in to comment.