Linux command
docker 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run
docker run [image]
List
docker ps
Build
docker build -t [name] [.]
Pull
docker pull [image]
Stop
docker stop [container]
Remove
docker rm [container]
Execute
docker exec -it [container] [bash]
说明
docker is a platform for developing, shipping, and running applications in containers. Containers package applications with their dependencies into standardized units, ensuring consistency across different environments from development to production. Docker has revolutionized application deployment and development workflows by solving the "it works on my machine" problem. It uses OS-level virtualization to isolate applications, making them portable, efficient, and easy to scale. Containers share the host kernel but maintain isolated filesystems, processes, and networking. The Docker ecosystem includes Docker Engine (the runtime), Docker Hub (image registry), and a comprehensive CLI for managing containers, images, networks, and volumes. Docker images are built in layers, making them efficient to distribute and update. The platform supports both single-container applications and complex multi-service architectures.
参数
- run _options_ _image_
- Create and start container
- ps -a
- List containers
- build -t _name_ _path_
- Build image from Dockerfile
- pull _image_
- Pull image from registry
- push _image_
- Push image to registry
- exec _container_ _command_
- Execute command in running container
- logs _container_
- Fetch container logs
- stop _container_
- Stop running container
- start _container_
- Start stopped container
- rm _container_
- Remove container
- rmi _image_
- Remove image
- images
- List images
FAQ
What is the docker command used for?
docker is a platform for developing, shipping, and running applications in containers. Containers package applications with their dependencies into standardized units, ensuring consistency across different environments from development to production. Docker has revolutionized application deployment and development workflows by solving the "it works on my machine" problem. It uses OS-level virtualization to isolate applications, making them portable, efficient, and easy to scale. Containers share the host kernel but maintain isolated filesystems, processes, and networking. The Docker ecosystem includes Docker Engine (the runtime), Docker Hub (image registry), and a comprehensive CLI for managing containers, images, networks, and volumes. Docker images are built in layers, making them efficient to distribute and update. The platform supports both single-container applications and complex multi-service architectures.
How do I run a basic docker example?
Run `docker run [image]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does run _options_ _image_ do in docker?
Create and start container