docker build -t docker-postgres . -f ./Dockerfile
docker create -t docker-postgres
docker start jovial_easley
docker exec -it jovial_easley bash
docker run --name mysql \
-ti -d -e MYSQL_DATABASE=name \
-e MYSQL_USER=user -e MYSQL_ROOT_HOST=0.0.0.0 \
-e MYSQL_PASSWORD=pwd -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 \
-v /tmp/mysql:/var/lib/mysql mysql --character-set-server=utf8mb4 \
--collation-server=utf8mb4_0900_as_cs
docker exec -it mysql mysql -u <user> -p<pwd> <db>
docker ps -aq -f status=exited | xargs docker start
export ID=$(docker ps -lq)
docker system df
docker system prune -a
docker volume ls -f name=runner --format "" | xargs docker volume rm
docker ps -aq -f status=exited | xargs -r docker rm
docker stats
docker inspect -f "" <container>
docker top <container>
docker diff <container>
docker history --no-trunc <image>
docker cp <file_path> <container:/dir_path>
docker cp <container:/file_path> <dir_path>
docker image prune -q -f dangling=true | xargs docker rmi
docker ps -a -q | xargs docker rm
docker network prune
docker volume ls -q -f dangling=true | xargs docker volume rm
# Hard core
docker system prune -f
docker run -ti -d --name localstack \
-v /home/localstack:/tmp/localstack \
-p 8080:8080 -p 4567-4584:4567-4584 \
-e aws_default_region=eu-west-1 \
-e port_web_ui=8080 localstack/localstack
docker run -it \
-v=postgres-data:/var/lib/docker/volumes/<volume_id>/_data busybox \
/bin/sh
docker login -u "docker-id" -p "mypassword" docker.io
docker tag my-container docker-id/image-name:tag
docker push docker-id/image-name:tag