Container
Copy from container to host
1 |
sudo docker cp sipd-populasi-be:/var/www/html/storage/logs/laravel.log /home/test/your-file.log |
Create and bind port, enviroment to Container
1 |
docker run -d --name zookeeper -p 2181:2181 -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper |
Exec apps/function on Container
1 |
docker exec kafka kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 2 --topic testing |
Exec app/function on container (with interaction)
1 |
docker exec -it postgres psql -h localhost -U odenktools |
Exec Bash Command
1 |
docker exec -it kafka /bin/bash |
1 |
docker exec -it kafka bash -l |
1 |
docker exec -it kafka sh |
Network
List all Docker networks
1 |
docker network ls |
Get details docker network
1 |
docker network inspect odknetkafka |
Images
List all Docker images
1 |
docker images |
Shows history of image
1 |
docker history confluentinc/cp-zookeeper:4.1.0 |
Docker Compose
Run all container on docker-compose
1 |
docker-compose up -d |
Build and Run all container
1 |
docker-compose up -d --build |
Stop all containers on docker-compose
1 |
docker-compose stop |
Remove all container on docker-compose
1 |
docker-compose down |
1 |
docker-compose down --remove-orphans |
Clean Up
Remove all containers from your system
1 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -qf dangling=true) |
Remove all Docker network
1 |
docker network rm $(docker network ls -q) |
Remove all Docker Swarm services
1 |
docker stop $(docker ps -a -q); docker service rm $(docker service ls -q) |
Remove all Docker image <NONE> from your system
1 |
docker image rm $(docker image ls -qf dangling=true) |
Remove all Docker image from your system
1 |
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker rmi $(docker images -q) |