Skip to content
Jay Dobies edited this page Sep 6, 2017 · 3 revisions

Cheatsheet

Run a container and expose a port to a local port:

docker run -p <local_port>:<container_port> <username>/<image>

Run a container and capture local terminal commands:

docker run -it <username>/<image>

Display detailed information about a container or image:

docker inspect <id>

Build an image with a specific tag (assuming the Dockerfile is in the current directory):

docker build -t <username>/<image_name>:<tag> .

Tag an image:

docker tag <source>:<tag> <new>:<tag>

Push an image to Docker Hub:

docker push <username>/<image>

Configuration

On Fedora, add insecure registries (technically, command line args) to:

/etc/sysconfig/docker
Clone this wiki locally