Common Docker Commands

General Commands

docker images
docker pull
docker create
docker ps
docker attach 3378689f2069

Deleting, cleanup

docker run —rm image_name
docker system prune
docker container prune

Ubuntu Image

docker pull ubuntu
docker run -d -t ubuntu # run detached
docker run -it ubuntu /bin/bash
docker exec -it /bin/bash
apt-get update
docker compose run -it web /bin/bash

Anaconda Image

docker pull continuumio/anaconda3
docker run -it continuumio/anaconda3 /bin/bash

Set up gui:

ROS Stuff:

Modified from:

To download and install and run ros:

docker pull osrf/ros:melodic-desktop-full
docker run \--name ros-dev -it osrf/ros:melodic-desktop-full bash
echo source \"/opt/ros/melodic/setup.bash\" \>\> \~/.bashrc
source \~/.bashrc

Anytime you want to develop in ROS, simply open a Powershell window and run the command below (make sure to substitute in the container name you chose to use before:

docker exec -it ros-dev bash

Setup vcXsrv

Put in your wifi’s ip address:

echo \'export DISPLAY=\' \>\> \~/.bashrc
echo \'export DISPLAY=\' \>\> \~/.bashrc

To install a terminal-compatible text editor

apt-get update
apt-get install nano

Accessing usb devices (not working):

docker run \--name ros-dev -t -i \--privileged -v /dev:/dev osrf/ros:melodic-desktop-full bash
docker run \--name ros-dev -t -i \--privileged -v /dev/bus/usb:/dev/bus/usb osrf/ros:melodic-desktop-full bash
docker run -t -i \--privileged -v /dev:/dev ubuntu bash


docker pull jekyll/builder
docker run \--name myjekyll -v c:/users/danaukes/websites:/srv/jekyll -it jekyll/builder bash