A simple Dockerfile for an Ubuntu 22.04 development environment. Portable for use with classes, projects, development, research, and more. It is also useful as an experimental sandbox and packaging your work for reproducible work for dissemination.
As of now these environments are only on Ubuntu but in theory should be able to be ported to other distros by changing the FROM
at the beginning of the Dockerfile. Keep in mind you may need to change the package manager and other distro-specific commands in the Dockerfile.
While the basic use command will work, looking at the readme.md
file in each respective directory will yield better results and more granular functionality.
docker run --name <container-name> -ti s7117/ubuntu-<suffix>:<tag>
WARNING: Do NOT use the docker start
command to launch additional shells. See Launching a second shell for this information.
To continue to use a container that was created by using the docker run
command above use the following once:
docker start -ai <container-name>
NOTE: If you did not name your container use docker container ls -a
to determine the Docker randomly assigned name/id.
Use the following command on a running Docker container to launch a new shell in the container (you can replace /bin/bash
with another command if you would like to run another shell/command):
docker exec -ti <container-name> /bin/bash
Use the following command to stop/terminate a running container:
docker stop <container-name>
See the README.md
in each respective directory for specific usage instructions and details.
See docs/common-docker.md for some common docker commands and their definitions.
- ubuntu-base - Customized Ubuntu Development Environment
- ubuntu-cuda - Customized CUDA Image
- ubuntu-cuda-ml - Machine Learning Image with PyTorch (torchgpu) and TensorFlow GPU (tfgpu) installed under Miniforge3
- ubuntu-ml - Machine Learning Image with PyTorch (torchgpu) and TensorFlow CPU (tfgpu) installed under Miniforge3
Use lsusb
and lspci
to confirm that the devices desired to be accessible in the Docker container appear.
Check that TensorFlow/PyTorch can see the GPU:
>>> # TensorFlow
>>> import tensorflow as tf
>>> tf.config.list_physical_devices('GPU')
>>> tf.sysconfig.get_build_info()['cuda_version']
>>> # PyTorch
>>> import torch
>>> torch.cuda.is_available()
>>> torch.version.cuda
If you want some easy and quick shortcuts for using Docker consider taking a look at my .dotfiles GitHub repository!
Some simple examples:
dils
: list all Docker imagesdcls
: list all Docker containersdrmi
: delete a Docker imagedrmc
: delete a Docker containerdclean
: delete all Docker containers and images and prune caches.