在windows 10 安装docker desktop 2.0.0.3

目的:我们是要得到一个linux的server。

步骤如下:

首先要开启虚拟技术

 下载docker ,Install Docker Desktop on Windows | Docker Documentation

下载好后安装

 安装完成需要重启windows去开启hyper-v

如果你想去访问官网,你可以去Docker Hub create一个account 

查看docker是否成功


点击Hyper-V Manager

 你可以看到MobyLinuxVM正在运行

 点击上图右边 hyper-v设定,可以更换虚拟机和虚拟机硬盘位置设定。不需要的可以不用设置。

 更改配置后需要重启 

可以自定义docker 资源配置

 

也可以共享driver,看自己需要

 如果是公司内部内网,需要设置代理

到此就ok了。

如果你想要windows server。

 可以docker info去看docker信息

需要改变默认docker地址(默认image地址应该是C:\ProgramData\Docker\windowsfilter,改变地址后image存放的目录应该会是设定目录下的windowsfilter这个目录,我这个没实操过)的可以点击basic,让它变advance

 修改下面就好,但这个目录必须先存在。

 之后重启docker。

How to SSH into the Docker VM (MobyLinuxVM)

How to SSH into the Docker VM (MobyLinuxVM) on Windows | Jon Gallant

该做法应该是说先run一个ubuntu 的container,通过这个container去访问MobyLinuxVM

get a privileged container with access to Docker daemon

docker run --privileged -it -v /var/run/docker.sock:/var/run/docker.sock jongallant/ubuntu-docker-client

run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff)

docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh

switch to host FS

chroot /host 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值