Docker Setup Guide#
To get the repository set up on non-Linux environments (e.g. macOS on Apple
Silicon), use the pre-configured Docker environment (linux/amd64) defined in
the Dockerfile.
1. Prerequisites#
-
Docker Desktop: Download and install from docker.com.
-
Rosetta on Apple Silicon: In Docker Desktop, enable Use Rosetta for x86/amd64 images under Settings ▶ Experimental Features.
-
Verify installation:
If hello-world succeeds, you're ready to proceed.
Apple Silicon Note: Some TensorFlow-related dependencies may not work properly on
linux/arm64. If Docker build fails, add--platform=linux/amd64to force x86_64 emulation. Note that emulation may be slow and TensorFlow workloads may crash or hang due to resource constraints. For heavy TF workloads, consider using a native Linux environment or cloud-based compute.
2. Build the Docker Image#
From the project root (where Dockerfile lives), run:
On Apple Silicon, the Dockerfile already specifies
--platform=linux/amd64. If you encounter issues, try explicitly passing the platform flag:
Confirm the image exists:
3. Run the Container in Detached Mode#
We recommend running the container detached so you can open shells, run tests, and launch Jupyter without tying up your terminal:
Note: This mounts your local code into
/workspacein the container, enabling live edits.
3.1 Access Jupyter#
Open your browser at:
Because we disable the token in our CMD, no password is needed. If you see a
deprecation warning for NotebookApp.token, you can instead use:
4. Exec into the Running Container#
To run commands inside the live container:
Inside the container, you're already in /workspace. Use Poetry to run
commands:
# Run tests
poetry run pytest -q
# Run a Python script
poetry run python path/to/script.py
# Check Python version (should be 3.11.x)
poetry run python --version
# Launch Jupyter (if not already running via CMD)
poetry run jupyter notebook --ip=0.0.0.0 --no-browser --ServerApp.token=''
Alternatively, run commands directly without exec:
# Run tests from outside the container
docker exec sbsim-container poetry run pytest -q
# Check Python version
docker exec sbsim-container python --version
5. Stop & Clean Up#
# Stop the container
docker stop sbsim-container
# Remove the container
docker rm sbsim-container
# Remove the image
docker rmi sbsim:latest
6. Troubleshooting#
-
Daemon not running: If you see
Cannot connect to the Docker daemon, open Docker Desktop or run: -
Platform mismatch: If you still get a warning about
linux/amd64vsarm64, ensure Rosetta support is enabled in Docker Desktop. -
Permission errors: By default, files created inside the container are owned by
root. To write files to your host, either adjust volume permissions or run with--user=$(id -u):$(id -g).
For ongoing improvements and discussion, see Issue #80.