Skip to content

Instantly share code, notes, and snippets.

@DeedleFake
Created April 18, 2024 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeedleFake/a9142d58dd54dc42782911ca73eb6f42 to your computer and use it in GitHub Desktop.
Save DeedleFake/a9142d58dd54dc42782911ca73eb6f42 to your computer and use it in GitHub Desktop.
Docker Configuration for Running Livebook in a Container with Tailscale as the Identity Provider

I had a very specific configuration I was trying to get working for personal usage. After a bunch of running in circles, this was the result. I figured I'd stick it somewhere public in case anyone else finds it useful.

#!/bin/bash
exec docker run \
--rm \
--name "livebook" \
--hostname "livebook" \
-e LIVEBOOK_IP="$(tailscale ip -4)" \
-e LIVEBOOK_PORT=8855 \
-e LIVEBOOK_IFRAME_PORT=8856 \
-e LIVEBOOK_IDENTITY_PROVIDER=tailscale:/var/run/tailscale/tailscaled.sock \
-e LIVEBOOK_TOKEN_ENABLED=false \
-v livebook-data:/data \
-v livebook-config:/home/livebook/.local/share/livebook \
-v /run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock \
-v /usr/bin/tailscale:/usr/bin/tailscale:ro \
--net host \
--pull always \
ghcr.io/livebook-dev/livebook:edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment