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).
Execution part of virtual environment created based on Docker image
A template that describes what you need to create a container
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
terminal.
% docker image build
% docker image build -t <Namespace>/<name>:<name>
terminal.
% docker image ls -a
terminal.
% docker container run
% docker container run -p <port number>:<port number> --name <Namespace>/<name>:<name>
terminal.
% docker container ls -a
terminal.
% docker container stop <name>
terminal.
% docker container rm <name>
terminal.
% docker container logs <name>
Docker Compose
terminal.
% docker-compose build
terminal.
% docker-compose up
terminal.
% docker-compose down
terminal.
% docker-compose ps
terminal.
% docker-compose logs
terminal.
% docker-compose run <service><command>
terminal.
% docker-compose exec <service><command>
terminal.
% docker --help
Recommended Posts