原文地址 https://docs.docker.com/get-started/
Prepare your Docker environment
配置你的Docker环境
Install a maintained version of Docker Community Edition (CE) or Enterprise Edition (EE) on a supported platform.
在可支持平台上安装一个正在更新维护的Docker社区版本或者企业版本
可支持平台见 https://docs.docker.com/ee/supported-platforms/
Docker版本详情见 https://docs.docker.com/install/
For full Kubernetes Integration
完整的k8s集成
Kubernetes on Docker Desktop for Mac is available in 17.12 Edge (mac45) or 17.12 Stable (mac46) and higher.
Kubernetes on Docker Desktop for Mac 18.02 以上的版本支持Mac (Stable, Edge分支)
Kubernetes on Docker Desktop for Windows is available in 18.02 Edge (win50) and higher edge channels only.
Kubernetes on Docker Desktop for Windows 18.02 以上的版本支持Windows (只有Edge分支支持)
安装Docker的链接
https://docs.docker.com/engine/installation/
Test Docker version
查看Docker版本
Run docker --version and ensure that you have a supported version of Docker:
在已经安装Docker的机器上执行 docker --version 命令
To avoid permission errors (and the use of sudo), add your user to the docker group. Read more.
使用sudo来解决一些权限问题, 添加用户到 docker 用户组 更多问题见 https://docs.docker.com/install/linux/linux-postinstall/
Test Docker installation
查看Docker是否被正确安装
Test that your installation works by running the simple Docker image, hello-world:
你可以通过运行一个简单的Docker镜像来检测Dcoker是否被正确安装 Hello-World Docker镜像下载链接 https://hub.docker.com/_/hello-world/
List the hello-world image that was downloaded to your machine:
列出你已经安装的hello-world镜像使用 >> docker image ls 命令
List the hello-world container (spawned by the image) which exits after displaying its message. If it were still running, you would not need the --all option:
列出所有helloo-world容器 使用 >> docker container ls --all 命令
Recap and cheat sheet
这一部分的重点
## List Docker CLI commands
docker
docker container --help
## Display Docker version and info
docker --version
docker version
docker info
## Execute Docker image
docker run hello-world
## List Docker images
docker image ls
## List Docker containers (running, all, all in quiet mode)
docker container ls
docker container ls --all
docker container ls -aq
Conclusion of part one
这一部分的结论
Containerization makes CI/CD seamless. For example:
applications have no system dependencies
updates can be pushed to any part of a distributed application
resource density can be optimized.
With Docker, scaling your application is a matter of spinning up new executables, not running heavy VM hosts.