Skip to content
andrzejsydor edited this page Feb 18, 2018 · 20 revisions

bind 'all interfaces' to 0.0.0.0

docker run --rm -it -p 3000:3000 -v

bind docker host's 127.0.0.1

127.0.0.1:3000:3000

docker build

docker build --no-cache -t imageName .

Shell Access

docker exec -it my-container-name bash

Docker Compose

docker-compose up -d -d detached

docker-compose ps

docker-compose stop

detaching containers without stopping them

Ctrl+P Ctrl+Q

clean

docker ps -a -q | \ xargs --no-run-if-empty docker rm -f

docker ps -a -q --filter status=exited | \ xargs --no-run-if-empty docker rm

docker container prune

Compare containers with error

comm -3 \ <(docker ps -a -q --filter=status=exited | sort) \ <(docker ps -a -q --filter=status=exited | sort) \ xargs --no-run-if-empty docker inspect > error_containers

Volumes

docker volume ls

docker volume inspect {volume_id}

Flattening images (remove secret information from the layer history)

docker export container-d - export to TAR

docker import ... - import from TAR

docker export container-id | docker import - container

sub-pages

Adminer

MySQL

Postgres

Portainer