Docker Setup Guide#
To get the repository set up on non-Linux environments, you can use the pre-configured Docker environment ("Linux/amd64") specified by the "Dockerfile".
Installing Docker#
First, install Docker Desktop, and accept the terms.
Open Docker Desktop, and wait until it is running before proceeding.
Verify the installation:
Troubleshooting Installation Issues on Mac#
On Mac, if verification fails, try:
If that works, as a one time setup step, update the ".zshrc" file to add the installed location to the path:
# this is the "~/.zshrc" file...
export PATH="/Applications/Docker.app/Contents/Resources/bin:$PATH"
Remember to restart your shell afterwards:
Now you should be able to verify the installation:
Image Operations#
Ensure you have navigated to the root directory of the repository, where the "Dockerfile" is located, before proceeding.
Build the image:
Listing images:
Removing the image, as necessary:
Container Operations#
After the image is built, run the container (in interactive mode, with open ports):
NOTE: the container will copy the repository into "/workspace/sbsim" on the first run. Use -v to persist changes.
To access Jupyter notebooks, visit http://localhost:8888 in the browser.
To run scripts or tests inside the actively running docker container:
# activate the virtual environment:
source /opt/venv/bin/activate
# navigate to the repository:
cd /workspace/sbsim
# running scripts:
python path/to/script.py
# running tests:
pytest
To stop the container:
Listing containers (to get their identifiers):
Removing a container:
NOTE: in the future we would like to further update these instructions and improve the Dockerfile. See issue #80 (contributions welcome)!