Skip to content

Docker Mac Commands

Docker Guides: docs.docker.com/go/guides

docker image ls or docker images

See a list of docker images on the local machine

docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options

  • -v, --version Print version information and quit

  • --config string -> Location of client config files (default /Users/g001494/.docker)

  • -c, --context string -> Name of the context to use to connect to the daemon

  • -D, --debug -> Enable debug mode

  • -H, --host list -> Daemon socket(s) to connect to

  • -l, --log-level string -> Set the logging level (debug|info|warn|error|fatal)

  • --tls -> Use TLS; implied by --tlsverify

    • --tlsverify -> Use TLS and verify the remote
    • --tlscacert string -> Trust certs signed only by this CA (default /Users/g001494/.docker/ca.pem)
    • --tlscert string -> Path to TLS certificate file (default /Users/g001494/.docker/cert.pem)
    • --tlskey string -> Path to TLS key file (default /Users/g001494/.docker/key.pem)

Management Commands

Management CommandsPurpose
builderManage builds
buildxDocker Buildx
composeDocker Compose
configManage Docker configs
containerManage containers
contextManage contexts
imageManage images
manifestManage Docker image manifests & manifest lists
networkManage networks
nodeManage Swarm nodes
pluginManage plugins
scanDocker Scan
secretManage Docker secrets
serviceManage services
stackManage Docker stacks
swarmManage Swarm
systemManage Docker
trustManage trust on Docker images
volumeManage volumes

Commands

CommandsPurpose
buildBuild an image from a Dockerfile
--------------------------------------------------------------------------------------
attachAttach local standard input, output, and error streams to a running container
commitCreate a new image from a container's changes
cpCopy files/folders between a container and the local filesystem
createCreate a new container
diffInspect changes to files or directories on a container's filesystem
eventsGet real time events from the server
execRun a command in a running container
exportExport a container's filesystem as a tar archive
historyShow the history of an image
imagesList images
importImport the contents from a tarball to create a filesystem image
infoDisplay system-wide information
inspectReturn low-level information on Docker objects
killKill one or more running containers
loadLoad an image from a tar archive or STDIN
loginLog in to a Docker registry
logoutLog out from a Docker registry
logsFetch the logs of a container
pausePause all processes within one or more containers
portList port mappings or a specific mapping for the container
psList containers
pullPull an image or a repository from a registry
pushPush an image or a repository to a registry
renameRename a container
restartRestart one or more containers
rmRemove one or more containers
rmiRemove one or more images
runRun a command in a new container
saveSave one or more images to a tar archive (streamed to STDOUT by default)
searchSearch the Docker Hub for images
startStart one or more stopped containers
statsDisplay a live stream of container(s) resource usage statistics
stopStop one or more running containers
tagCreate a tag TARGET_IMAGE that refers to SOURCE_IMAGE
topDisplay the running processes of a container
unpauseUnpause all processes within one or more containers
updateUpdate configuration of one or more containers
versionShow the Docker version information
waitBlock until one or more containers stop, then print their exit codes