Select Page

Description


This article gives common docker command syntax examples on a Mac with Docker Toolbox (VirtualBox) installed.

Prerequisites


  • Docker Toolbox for Mac Installed
  • Open Docker CLI

Images


List Images


Import Tarball to Create Image


Export Image to Tarball


Remove Image


Containers


List Containers


List running containers

List All Containers


List running and stopped containers

List Lastest Container


List latest created container

Create Container from Docker Hub Image


Create a new container from a Docker Hub Image.

Run Command on a Container


Login to a Container


Copy Files to a Container


Copy files from local system to a container.

Fetch Logs of a Container


Start, Stop, Restart and Kill a Container


Remove a Container


Server


List Current Docker Server Information


List information about the Docker Server that is currently configured in the Shell with environment variables.

List Docker Servers


List all Docker Servers that the containers are spun up on.

Start, Stop & Restart a Docker Server


List Docker Server Environment


List a Docker Server environment.

Switch Default Docker Server in Shell


To switch the environment variables to point to another Docker Server (machine) temporarily in a shell we can use the eval command and Docker machine name.

Upgrade Docker Server


Upgrade a Docker Server to the latest Docker version.

Upgrade Docker Server


Upgrade a Docker Server to the latest Docker version.

Sources