当前位置: 首页 » 综合知识 » it知识 » 正文

在Mac OS X怎么安装Docker

发布时间:2023-07-23 以下文章来源于网友投稿,内容仅供参考!

mac os x用户使用docker toolbox安装docker软件, docker toolbox包含了下列的docker 工具:

由于docker engine守护进程使用特定的linux内核的功能, 你无法再本地的os x运行docker engine, 与之代替的是你必须使用docker machine命令docker-machine在你本地的机器创建并连接一个小型的linux虚拟机. 这个就在你mac上的虚拟主机就是docker machine.

第一步,检查版本

你的mac必须运行os x 10.8 “mountain lion”或以上的系统才能运行docker, 你可以这样查看os的版本:

1、从苹果菜单中选择”关于本机”


2、如果你的版本正确,就可以进行下一步了

如果你没有使用支持的版本,你需要考虑先升级的你操作系统

第二步,安装docker toolbox

1、访问docker toolbox

2、点击下载链接

3、通过双击下载的安装包, 或者右键安装包在弹出的菜单中选择”打开”, 来安装docker toolbox

安装程序将启动一个介绍对话框,介绍安装内容的概述。

4、点击”继续”安装toolbox

安装程序为你提供了选项, 自定义标准安装

默认的, 标准的docker toolbox安装:

现阶段, 不要修改任何的默认选线

5、点击”安装”, 执行标准安装

系统会提示你输入密码

输入你的密码, 继续完成安装

当它完成后,安装程序提供了一些快捷键。您可以忽略此为现在和点击继续。

点击”关闭”结束安装

第三步, 验证安装

为了运行一个docker容器, 你需要:

一旦你创建了docker machine, 你可以想任何一个virtual box vm一样随时使用它, 它会保持你使用后的相关配置.

1、打开launchpad, 找到docker quickstart terminal图标

2、点击docker quickstart terminal图标, 打开一个窗口.

终端会做一系列的事情来为你设置docker quickstart terminal

last login: sat jul 11 20:09:45 on ttys002
bash '/applications/docker quickstart terminal.app/contents/resources/scripts/start.sh'
get /var/run/docker.sock/v1.19/images/json?all=1&filters=%7b%22dangling%22%3a%5b%22true%22%5d%7d: dial unix /var/run/docker.sock: no such file or directory. are you trying to connect to a tls-enabled daemon without tls?
get /var/run/docker.sock/v1.19/images/json?all=1: dial unix /var/run/docker.sock: no such file or directory. are you trying to connect to a tls-enabled daemon without tls?
-bash: lolcat: mand not found

mary at meepers in ~
$ bash '/applications/docker quickstart terminal.app/contents/resources/scripts/start.sh'
creating machine dev...
creating virtualbox vm...
creating ssh key...
starting virtualbox vm...
starting vm...
to see how to connect docker to this machine, run: docker-machine env dev
starting machine dev...
setting environment variables for machine dev...

          ##     .
       ## ## ##    ==
      ## ## ## ## ##  ===
    /"""""""""""""""""\___/ ===
 ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
    \______ o      __/
     \  \     __/
     \____\_______/

the docker quick start terminal is configured to use docker with the “default” vm.

3、在终端窗口上点击鼠标用来激活

如果你不熟悉终端窗口,这里有一些快速提示。

该提示是传统的$美元符号。你输入命令在命令行这是提示后的区域。您的光标被突出显示的区域或指示|出现在命令行。键入命令后,一直按回车键。

4、键入命令docker run hello-world然后按回车键

该命令为你做了一些工作,如果一切运行良好,则该命令的输出如下所示:

$ docker run hello-world
unable to find image 'hello-world:latest' locally
latest: pulling from library/hello-world
535020c3e8ad: pull plete
af340544ed62: pull plete
digest: sha256:a68868bfe696c00866942e8f5ca39e3e31b79c1e50feaee4ce5e28df2f051d5c
status: downloaded newer image for hello-world:latest

hello from docker.
this message shows that your installation appears to be working correctly.

to generate this message, docker took the following steps:
1. the docker engine cli client contacted the docker engine daemon.
2. the docker engine daemon pulled the "hello-world" image from the docker hub.
3. the docker engine daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4. the docker engine daemon streamed that output to the docker engine cli client, which sent it to your terminal.

to try something more ambitious, you can run an ubuntu container with:
$ docker run -it ubuntu bash

share images, automate workflows, and more with a free docker hub account:
https://hub.docker

for more examples and ideas, visit:
https://docs.docker/userguide/

寻找故障排除帮助?

通常情况下,上述步骤工作外的开箱,但某些情况下可能会出现问题。如果你的docker运行的hello-world没有工作,出现了错误,请查看故障排除快速修复常见问题。

  • • Linux Ecdsa密钥长度选择有何依据

    在Linux

  • • Linux Khook在内核监控中的应用如何

    Linux

  • • Linux Gsoap是否支持异步通信

    GSOAP是

  • • Linux Coremail如何提升用户体验

    提升Linu

  • • Linux Ecdsa算法有哪些局限性

    ECDSA

  • 哎呀音乐钢琴键盘学习《 钢琴主人训练营》 西瓜学琴
    郭蝈 陪练钢琴 30节课时 考级刚需 让孩子每一次练琴都是高质量的
    30天轻松学会五线谱 流行钢琴自学初级教程 牙牙学琴
    流行爵士钢琴实战技巧VIP课 - 继伟 哎呀音乐
    【海上钢琴师】原版 MT1990钢琴谱
    百首经典流行钢琴实战曲集 - 继伟
    雷费尔德电钢琴重锤88键专业考级儿童初学者数码电子钢琴家用
    小练咖 真人钢琴陪练 1v1服务 2999随时退 1课时50分钟 考级刚需
    雅马哈电钢琴88键重锤CLP735智能数码电子钢琴家用专业初学者考级
    【原装进口】Yamaha/雅马哈钢琴 b121 SC2原声静音钢琴
  • 珠海专业调钢琴
  • 天津宝坻区调钢琴
  • 天津静海区钢琴调音
  • 成都简阳市钢琴调律
  • 大连瓦房店市钢琴调音
  • 眉山调钢琴联系方式
  • 惠州大亚湾钢琴调琴师
  • 长治调琴师
  • 厦门湖里区钢琴调音师
  • 上海普陀区钢琴调音师