mac上面运行docker

发布时间 2023-12-02 18:00:43作者: 裏表異体

docker简介

docker是一种容器技术。
image

在mac中启动docker服务

launchctl list | grep docker # 查看是否启动了服务
open /Applications/Docker.app &  # 如果已经通过img安装了docker,可以这样启动,或者直接点击桌面图标启动

运行busybox镜像输出“hello world"

 docker run busybox echo "Hello world"

查看已有镜像

docker iamges

image

从仓库pull镜像下来

docker pull ubuntu # 拉取镜像
docker run -it ubuntu /bin/bash # 创建容器以交互的方式运行ubuntu中的bash

image

移除镜像

docker rmi [image]