Skip to content

Instantly share code, notes, and snippets.

@robert-skarzycki
Last active February 22, 2019 09:39
Show Gist options
  • Save robert-skarzycki/6c12cacbd4d2b80a28313a9e9f579ef5 to your computer and use it in GitHub Desktop.
Save robert-skarzycki/6c12cacbd4d2b80a28313a9e9f579ef5 to your computer and use it in GitHub Desktop.
Cheat sheet for docker commands

Build image

docker build -t <template_name> .

Run build image & redirect port

docker run -p <port_on_host>:<port_in_container> <image_name>

List of running container instances

docker ps

Log into running instance bash

docker exec -it <instance_name> /bin/bash

Run any command in running instance

docker exec -it <instance_name> <command>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment