Skip to content

Instantly share code, notes, and snippets.

@frederikstroem
Last active December 31, 2023 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frederikstroem/49d8f8075f924f7e8102503923795ab4 to your computer and use it in GitHub Desktop.
Save frederikstroem/49d8f8075f924f7e8102503923795ab4 to your computer and use it in GitHub Desktop.
Run tensorflow/tensorflow:latest-gpu-jupyter docker image on localhost without having to authenticate. Useful if you SSH into your machine etc.
version: "3.9"
# https://www.tensorflow.org/install/docker
services:
tensorflow:
image: tensorflow/tensorflow:latest-gpu-jupyter # https://hub.docker.com/r/tensorflow/tensorflow/
container_name: tensorflow
hostname: tensorflow
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/gpu-jupyter.Dockerfile
# https://stackoverflow.com/a/60327026
# https://stackoverflow.com/a/47509274
command: bash -c "source /etc/bash.bashrc && jupyter notebook --notebook-dir=/tf --ip 0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --NotebookApp.password=''"
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
# https://stackoverflow.com/a/68385928
deploy:
resources:
reservations:
devices:
- capabilities: [gpu, utility, compute, video]
ports:
- 127.0.0.1:8888:8888
volumes:
- ~/tensorflow/notebooks:/tf/notebooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment