Docker terms and commands

the term

Docker A mechanism that makes it easy from application development to deployment by creating a virtual environment (container) that packages the necessary environment (OS, library, application).

container

Execution part of virtual environment created based on Docker image

Docker image

A template that describes what you need to create a container

Docker registry

Store Docker images online Dockerfile Describe environment construction such as commands and libraries Docker Compose Link multiple applications and manage them collectively docler-compose.yml Describe the container to be managed collectively

command

Docker image

Image creation

terminal.


% docker image build
% docker image build -t <Namespace>/<name>:<name> 

Image list

terminal.


% docker image ls -a 

Docker container

Container creation / start

terminal.


% docker container run
% docker container run -p <port number>:<port number> --name <Namespace>/<name>:<name>

Container list

terminal.


% docker container ls -a

Container stop

terminal.


% docker container stop <name>

Delete container

terminal.


% docker container rm <name>

Check the container log

terminal.


% docker container logs <name>

Docker Compose

Creating an image

terminal.


% docker-compose build

Container creation / start

terminal.


% docker-compose up

Stop / delete container

terminal.


% docker-compose down

Container list

terminal.


% docker-compose ps

View log

terminal.


% docker-compose logs

Execute command

terminal.


% docker-compose run <service><command>

Execute command to a running container

terminal.


% docker-compose exec <service><command>

Docker command list

terminal.


% docker --help

Recommended Posts

Docker terms and commands
Docker basic commands
[Challenge Docker from 0] Overview and terms of Docker
Introduction of Docker Hub and commands Self-learning ①
Docker installation and initialization
[Terms] Static and dynamic
Docker Frequently used commands
Docker settings and this and that
Overview of Docker and containers
Latest docker installation (Ubuntu 20.04 and Ubuntu 20.10)
Installing and building Docker (memo)
Docker network related research & configuration commands
Hello World with Docker and C
Summary of frequently used Docker commands
2. Create Docker image and register Registry
Microservices With Docker and Cloud Performance
Challenge to install WSL2 and docker
Docker related commands (notes for yourself)
Introduction to Docker (1) Frequently used commands
docker
About Docker, disguise server and container
Raspberry Pi Kubernetes and Docker downgraded story
Install docker and docker-compose on Alpine Linux
Building Rails 6 and PostgreSQL environment with Docker
Kind @ Mac in Docker and vctl container
[AWS ECR] Save and get Docker images
Frequently used functions and commands of Xcode
Edit Mysql with commands in Docker environment
Docker Compact Manual (2: Mount and Data Persistence)
Communicate Gitlab and Gitlab Runner launched with Docker
Let's finally use Docker: Terms, Images, Launch
Commands that helped resolve errors in Docker
Note: [Docker] How to start and stop
Install Docker and create Java runtime environment