声明:
本文用于本人技术学习和备忘。水平有限,如有错漏欢迎指正!
原创不易,如有转载请标注出处:https://blog.csdn.net/luyou0401/article/details/126565019
02-Mac安装Docker
Docker版本号:20.10.17
下载
官网地址:https://www.docker.com
点击“Download Docker Desktop”进行安装包下载,下载文件为:Docker.dmg
上传CSDN文件地址:https://download.csdn.net/download/luyou0401/86501412
安装
官方文档:https://docs.docker.com/desktop/install/mac-install/
官方条款 和 系统要求 详见↑↑↑
重要条款:
- 对于小型企业(少于 250 名员工和少于 1000 万美元的年收入)、个人使用、教育和非商业开源项目,它仍然是免费的。
- 它需要付费订阅才能在大型企业中用于专业用途。
- 这些条款的生效日期为 2021 年 8 月 31 日。
- 现有的 Docker 免费订阅已重命名为Docker Personal,我们引入了 Docker Business 订阅。
- Docker Pro、Team 和 Business 订阅包括 Docker Desktop 的商业用途。
交互式安装
1、双击Docker.dmg
打开安装程序,然后将 Docker 图标拖到 Applications 文件夹。
2、“启动台“ 双击Docker.app
以启动 Docker
3、授权,点击"ok"并输入密码确认
4、Docker 菜单显示 Docker 订阅服务协议窗口。它包括对 Docker Desktop 使用条款的更改。
5、安装完成
配置镜像加速
本人使用阿里云云镜像服务,参考文档地址:
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
加速器地址:
配置指引:
操作如下:
1、点击菜单栏Docker应用图标,选择“Perferences”
2、点击左侧选项卡“Docker Engine”,添加"registry-mirrors"配置信息,如图:
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors": ["https://smeg4qi2.mirror.aliyuncs.com"]
}
3、点击“Apply & Restart”完成配置,终端命令行验证加速器是否配置成功
### 查看Docker版本信息
luyou@MacBook-Pro-yaco ~ % docker --version
Docker version 20.10.17, build 100c701
### 查看Docker服务信息
luyou@MacBook-Pro-yaco ~ % docker info
~~~
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5000
127.0.0.0/8
Registry Mirrors:
https://smeg4qi2.mirror.aliyuncs.com/
Live Restore Enabled: false
~~~
常用命令
命令文档地址:https://docs.docker.com/reference/
命令:
yaco@MacBook-Pro-yaco ~ % docker --help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default "/Users/luyou/.docker")
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default "/Users/luyou/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "/Users/luyou/.docker/cert.pem")
--tlskey string Path to TLS key file (default "/Users/luyou/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
builder Manage builds
buildx* Docker Buildx (Docker Inc., v0.8.2)
compose* Docker Compose (Docker Inc., v2.7.0)
config Manage Docker configs
container Manage containers
context Manage contexts
extension* Manages Docker extensions (Docker Inc., v0.2.8)
image Manage images
manifest Manage Docker image manifests and manifest lists
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
sbom* View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan* Docker Scan (Docker Inc., v0.17.0)
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
声明:
本文用于本人技术学习和备忘。水平有限,如有错漏欢迎指正!
原创不易,如有转载请标注出处:https://blog.csdn.net/luyou0401/article/details/126565019