Mac环境下的Docker基本配置

安装Docker

https://store.docker.com/editions/community/docker-ce-desktop-mac

注意:这个就是所谓的Docker Desktop

直接安装

配置阿里云加速器

https://dev.aliyun.com/detail.html

登录后,点击一个镜像后,右边有加速地址,你的账号内,所有镜像都是一样的,这个地址在管理中心也能看到

https://cr.console.aliyun.com/cn-hangzhou/mirrors

把对应的地址加到如下配置文件就可以了

Mac环境下的Docker基本配置_第1张图片

以CentOS为例如下:

bennydeMacBook-Pro:~ benny$ docker pull centos
Using default tag: latest
latest: Pulling from library/centos
aeb7866da422: Pull complete 
Digest: sha256:67dad89757a55bfdfabec8abd0e22f8c7c12a1856514726470228063ed86593b
Status: Downloaded newer image for centos:latest
bennydeMacBook-Pro:~ benny$ docker images
REPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE
centos                              latest              75835a67d134        5 weeks ago         200MB
hub.c.163.com/library/hello-world   latest              1815c82652c0        17 months ago       1.84kB
bennydeMacBook-Pro:~ benny$ docker run -ti 7583 /bin/bash
[root@c0cb9c0cea30 /]# ls
anaconda-post.log  dev  home  lib64  mnt  proc  run   srv  tmp  var
bin                etc  lib   media  opt  root  sbin  sys  usr
[root@c0cb9c0cea30 /]# idr
bash: idr: command not found
[root@c0cb9c0cea30 /]# exit

最后命令exit退出镜像返回到Mac命令行中。

 

你可能感兴趣的:(Docker)