Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Docker in MacOS

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about how to install Docker in MacOS. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.

1. Install docker toolbox,virtualbox# brew cask install virtualbox# brew cask install docker-toolbox2 and register Ali docker Accelerator

This step is not necessary, but I think it is still necessary to do it. The server is abroad, you know.

3. Create an imagedocker-machine create-- engine-registry-mirror= https://aurtqjzl.mirror.aliyuncs.com-d virtualbox default

The command also generates a configuration file for docker machine in the ~ / .docker/machine/machines/default directory. You only need to execute the create command once. You can then use the docker-machine command to start, stop, query, and manage the virtual machine.

If not added at the time of creation, the accelerator. You can do the following

$docker-machine ssh default / / ssh to default$ cat / var/lib/boot2docker/profileEXTRA_ARGS='--label provider=virtualbox--registry-mirror https://aurtqjzl.mirror.aliyuncs.com / / add 'CACERT=/var/lib/boot2docker/ca.pemDOCKER_HOST='-H tcp://0.0.0.0:2376'DOCKER_STORAGE=aufsDOCKER_TLS=autoSERVERKEY=/var/lib/boot2docker/server-key.pemSERVERCERT=/var/lib/boot2docker/server.pem4 The environment variable $docker-machine env default / / default of default is the name export DOCKER_TLS_VERIFY= "1" export DOCKER_HOST= "tcp://192.168.99.100:2376" export DOCKER_CERT_PATH= "/ Users/zhangying/.docker/machine/machines/default" export DOCKER_MACHINE_NAME= "default" # Run this command to configure your shell:# eval "$(docker-machine env default)" 5 created above. Activate default# eval "$(docker-machine env default)" zhangyingdeMacBook-Pro:machines zhangying$ docker-machine lsNAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORSdefault * virtualbox Running tcp://192.168.99.100:2376 v17.05.0-cemytest-virtualbox Stopped Unknown

A * sign indicates activation.

6. Start centos$ docker run-it centos

It will prompt you that you don't have centos, and then you will download it.

These are all the contents of the article "how to install Docker in MacOS". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report