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

相关推荐
lucky-billy5 分钟前
Ubuntu 下一键部署 ROS2
linux·ubuntu·ros2
阿梦Anmory15 分钟前
Ubuntu配置代理最详细教程
linux·运维·ubuntu
忆~遂愿1 小时前
CANN metadef 核心解析:计算图原型定义、算子元数据抽象与异构系统互操作机制
docker·容器
getapi1 小时前
Ubuntu 22.04 服务器的系统架构是否为 amd64 x86_64
linux·服务器·ubuntu
小天源2 小时前
Cacti在Debian/Ubuntu中安装及其使用
运维·ubuntu·debian·cacti
说实话起个名字真难啊2 小时前
用docker来安装openclaw
docker·ai·容器
恬静的小魔龙2 小时前
【群晖Nas】群晖Nas中实现SVN Server功能、Docker/ContainerManager等
docker·svn·容器
Zfox_3 小时前
CANN Catlass 算子模板库深度解析:高性能 GEMM 融合计算、Cube Unit Tiling 机制与编程范式实践
docker·云原生·容器·eureka
独自归家的兔3 小时前
ubuntu系统安装dbswitch教程 - 备份本地数据到远程服务器
linux·运维·ubuntu
ONE_SIX_MIX3 小时前
ubuntu 24.04 用rdp连接,桌面黑屏问题,解决
linux·运维·ubuntu