Skip to content

Instantly share code, notes, and snippets.

@scallacs
Last active April 22, 2018 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scallacs/c09a040d02c77e8e61099601bdc391cf to your computer and use it in GitHub Desktop.
Save scallacs/c09a040d02c77e8e61099601bdc391cf to your computer and use it in GitHub Desktop.
Docker / Docker compose cheat sheet

Docker

# List process
docker ps
# Networkds
docker network ls

Bash inside a container

docker exec -it <mycontainer> bash

Install vim inside container:

apt-get update
apt-get install vim

Copy file into a container

docker cp myfile containerid:path

Docker compose

Run

docker-compose up -d

Recreate a container

docker-compose stop
docker-compose rm
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment