A cheatsheet with basic docker and docker-compose commands
docker exec -it <nam> /bin/bash
attach interactive tty to the running image
docker run <name> --rm
remove after creation
docker run --rm --name test_container \
-e FOO=1 \
-p "8080:80" \
-v ".:/srv/app" \
namespace/image_name:version
docker-compose up [service]
Starts a service or all servicesdocker-compose ps
Lists all running or paused servicesdocker-compose exec [service] /bin/bash
Executes a command on a running servicedocker-compose run --rm [service] echo foo
Executes a single command on a service
create a docker-compose.yml