Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Latest commit

 

History

History
123 lines (83 loc) · 1.72 KB

File metadata and controls

123 lines (83 loc) · 1.72 KB

<-- Back

Docker Commands

Docker Compose

Show running services

docker-compose ps

Show all services

docker-compose config --services

Start service

docker-compose up service

Stop docker-compose service

docker-compose down service

Start all services

docker-compose up

Stop all services

docker-compose down

Start services in detached mode

Starts a docker-compose service in the background so that the terminal is not blocked. This command can be used to start multiple services.

docker-compose up -d service1 service2 service3

Open terminal in running docker-compose service

docker-compose exec service bash

Run docker-compose service with a command

docker-compose run service command

Run docker-compose service that does not have a command

For containers that have no startup command, this will open the terminal inside the container.

docker-compose run service

Docker

Show all docker images

docker images

Open terminal in running docker-compose service

docker exec -it service /bin/bash

Delete docker imagges matching pattern

docker rmi $(docker images -a | grep "pattern" | awk '{print $3}')

List all docker containers including inactive

docker ps -a

List all docker container ids

docker ps -aq

Remove all docker containers

docker rm $(docker ps -aq)

List all docker image ids

docker ps -aq

Remove all docker images

docker rmi $(docker images -aq)

Remove everything from docker

docker system prune