Last active
February 19, 2024 07:53
-
-
Save jimwhite/bc44ad2e3e1b4647afd2d5c4de87ccb6 to your computer and use it in GitHub Desktop.
Quickstart for running Python using NixOS flox.dev in Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run Docker image with NixOS and flox: | |
# https://flox.dev/docs/install-flox/ | |
# docker run --pull always --rm -it ghcr.io/flox/flox | |
docker run -it ghcr.io/flox/flox | |
# Then in that shell: | |
# flox config --set-bool disable_metrics true | |
cd ~ | |
flox init | |
flox install python311Packages.python | |
flox activate | |
# Which nests into another shell: | |
python -m venv .venv | |
source .venv/bin/activate | |
# I think https://github.com/flox-examples/hello-python is supposed to do that somehow | |
# but I couldn't figure out the intended commands. | |
# There is an issue for flox which intends to automagically make Python requirements.txt work: | |
# https://github.com/flox/flox/issues/1027 | |
# Check out this video from DockerCon 2023 about Nix and Docker together: | |
# https://www.youtube.com/watch?v=l17oRkhgqHE | |
# The second/main demo of that video used this (which is a Swiss army knife of Docker and Nix features): | |
# https://github.com/docker/babashka-pod-docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment