win环境下DockerDesktop和wsl访问localhost:8888问题解决笔记

wsl安装Ubuntu介绍

1、虚拟机上面使用ubuntu已经在行业界内都默认作为常有知识点了,但是wsl上面安装或许对于大多数小白来说还是比较新颖的,淡定的说包括我自己在内。总体而言就是将ubuntu内核二进制文件在win环境下vm执行,所以在配置上如果要安装插件和依赖库还是比较难受的。安装教程很多都在微软官方教程文档里面有介绍,下面是对应的链接:
Docs Windows 开发环境 wsl 介绍与安装

安装DockerDesktop

其实善于观察细节的你会发现在上面链接中也会有关于DockerDesktop的安装教程在这里插入图片描述
安装问题,该软件可能因为最新版没有选择安装目录的功能,默认安装到了C目录下,所以建议参考其他博客上发布的很好的文章参考一下。

就Apollo的容器介绍如何处理无法在win环境浏览器使用访问localhost:8888

1、本身wsl在win环境中就虚拟设置了Network Adapter网络适配器,也就意味着它和我们win环境保留着通讯的网络接口,没错就是它。
2、在使用的时候其实具体目前而言也不清楚具体操作原理是怎么样的,在使用apollo的edu套件使用更改如下,将之前的–net host 更改为如下所示:
在这里插入图片描述
接着修改以下文件
在这里插入图片描述
这时候基本上已经修改好了,重新启动容器并按照下面命令即可解决对应的问题,重新启动容器,同时获取当前虚拟机的IP地址,在win环境的浏览器http搜索栏输入IP:8888即可正常进入:

bash scripts/edu_launcher.sh start -f
(该命令是重新启动配置容器,突然具体忘记是啥意思了,尴尬。。。)

其实还有个疑惑点,没尝试过

就是在DockerDesktop里面还有个设置,勾选应该会有惊喜,只是个人感觉,有激情的小伙伴可以尝试一二并回复评论就好了,让我知道知道,懒是我的座右铭。
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Docker Desktop with WSL (Windows Subsystem for Linux) allows you to run Docker containers on Windows using a Linux distribution. By integrating Docker with WSL, you can leverage the benefits of both Docker and WSL to develop and run containerized applications on your Windows machine. To get started with Docker Desktop and WSL, you need to follow these steps: 1. Install Docker Desktop: Download and install Docker Desktop for Windows from the Docker website. Make sure to enable the WSL 2 backend during installation. 2. Enable WSL: Open PowerShell as an administrator and run the following command to enable WSL: ``` wsl --install ``` This command will install WSL and Linux kernel updates on your Windows machine. 3. Choose a Linux distribution: Open the Microsoft Store, search for your preferred Linux distribution (e.g., Ubuntu, Debian), and install it. This distribution will be used by Docker to run containers. 4. Set WSL version: Open PowerShell as an administrator and run the following command to set WSL version 2 as default: ``` wsl --set-default-version 2 ``` 5. Configure Docker to use WSL: Open Docker Desktop, go to "Settings," select "General," and check the "Use the WSL 2 based engine" option. Then, select the WSL default distribution you installed in step 3. 6. Test Docker: Open a terminal (WSL) and run the following command to verify that Docker is working: ``` docker run hello-world ``` If everything is set up correctly, you should see a "Hello from Docker!" message. That's it! Now you can start running Docker containers using the Linux distribution installed through WSL. Remember that you can also access files and directories on your Windows machine from within the Linux environment to build and run your containerized applications.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值