mac安装ubuntu docker

1、安装vmware

https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion

下载vmware fusion for mac

2、安装ubuntu

https://ubuntu.com/

3、安装docker

ubuntu中在浏览器输入docker.com-->documentation-->docker engine-->supported platforms中选择ubuntu,复制粘贴install using the apt repository中第一条和第二条。

执行第三条检验,若不成功,可采取以下解决方法:

复制代码
sudo mkdir -p /etc/docker && \
echo '{"registry-mirrors":["https://run-docker.cn"],"dns":["119.29.29.29","114.114.114.114"]}' | sudo tee /etc/docker/daemon.json > /dev/null && \
sudo systemctl daemon-reexec
sudo systemctl restart docker

之后再次运行:

复制代码
sudo docker run hello-world 

若出现hello from docker 则为安装成功。

4、简化命令

复制代码
sudo usermod -aG docker $USER
newgrp docker

之后输入命令时就可以不用加sudo了,比如:

复制代码
docker ps -a

5、nginx

复制代码
docker run --rm -d -p 8080:80 --name my-nginx nginx

在ubuntu中的浏览器输入http://localhost:8080/,若出现welcome to nginx 则为成功。

参考视频:

【[最新] Mac + VMware 安装 Ubuntu 虚拟机,100%成功、保姆级教程!Intel/M芯片 + sever版/桌面版-哔哩哔哩】 https://b23.tv/BYEMaAX

【Ubuntu 24.04 LTS安装 docker 完整过程-哔哩哔哩】 https://b23.tv/xaCFXhh

相关推荐
小王要努力上岸2 小时前
[特殊字符] Nginx全栈实战指南:Rocky Linux 10 & Ubuntu 24.04 双系统部署
linux·nginx·ubuntu
小Pawn爷8 小时前
14.VMmare安装ubuntu
linux·运维·ubuntu
engchina9 小时前
WSL Ubuntu で Kubernetes v1.34.2 + Docker 環境を構築する
ubuntu·docker·kubernetes
HABuo9 小时前
【linux文件系统】磁盘结构&文件系统详谈
linux·运维·服务器·c语言·c++·ubuntu·centos
oMcLin13 小时前
2025年必备的Docker命令指南与实战示例
docker·容器·eureka
AtoposのCX33013 小时前
Docker运行hello-world镜像失败或超时
运维·docker
sun cat13 小时前
Docker详细介绍(6)
docker·容器·docker-compose
生活很暖很治愈14 小时前
Linux——基础IO&软硬链接
linux·ubuntu
Roc.Chang15 小时前
Ubuntu 下 VLC 无法启动(Segmentation fault)终极解决方案
linux·ubuntu·vlc·媒体播放
Anesthesia丶15 小时前
Ubuntu20.04 升级 Ubuntu24.04 LTS
ubuntu