我刚刚升级到 Windows 10 Home May 2020,激活 WSL2并安装Docker Desktop。
WSL2必须安装在我的系统盘中,这是一个小型SSD。我不想用 docker 图像填充它。如何更改 docker 图像路径?我想在我的大 Windows 文件系统中使用一个路径。
该图像位置有点混乱。我相信它在/mnt/wsl/docker-desktop-data/
.
如何更改 WSL2 中 docker 镜像的目录?我可以更改 docker 配置以/mnt/d
在 docker 数据目录上选择一个路径,或者从 /mnt/d 挂载一个路径吗?
我在 WSL2 上使用 Ubuntu(不是在 Docker 桌面上)。
\n根据如何修复 docker \xe2\x80\x98Cannot connect to the Docker daemon at unix:///var/run/docker.sock。Ubuntu 上的 docker 守护进程是否正在运行?\xe2\x80\x99,我可以在启动时自动启动 docker 守护进程
\nsudo systemctl enable docker\n
Run Code Online (Sandbox Code Playgroud)\n而不是在每次启动时重新启动它
\nsudo systemctl start docker\n
Run Code Online (Sandbox Code Playgroud)\n这两个命令都避免了“无法连接到位于 unix:///var/run/docker.sock 的 Docker 守护进程。docker 守护进程正在运行吗?”。
\n当使用两者中的任何一个时,我得到
\n\n\n使用 \n/lib/systemd/systemd-sysv-install 将 docker.service 的状态与 SysV 服务脚本同步。执行:\n/lib/systemd/systemd-sysv-install 启用 docker
\n
测试运行显示,docker 尚未运行:
\n\n\nRun Code Online (Sandbox Code Playgroud)\ndocker run hello-world \n
docker:无法连接到 \nunix:///var/run/docker.sock 处的 Docker 守护程序。docker 守护进程是否正在运行?请参阅\n\'docker run --help\'。
\n
之前的一些步骤,此时我也收到了不同的消息:
\n\n …
我已在 Windows 10 中安装了Anaconda 2019.03 for Windows Installer。在 Powershell 上输入以开头的任何内容时conda
出现错误:
conda :术语“conda”不被识别为 cmdlet、函数、脚本文件或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
我尝试过以下解决方案,但没有解决问题:
“C:\Users\用户名\Anaconda3\Scripts\activate.bat”不被识别为内部或外部命令、可操作程序或批处理文件。
activate.bat
文件。& :术语“C:\Users\用户名\Anaconda3\shell\condabin\conda-hook.ps1”未被识别为 cmdlet、函数、脚本文件或可操作程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
C:\Users\user-name\Anaconda3\shell
当我查看时,Path 并不存在。列出的附加信息:
C:\Users\user-name\Anaconda3\envs
是空的我应该怎么做才能解决这个问题?
I want to create some neural network in tensorflow 2.x that trains on a GPU and I want to set up all the necessary infrastructure inside a docker-compose network (assuming that this is actually possible for now). As far as I know, in order to train a tensorflow model on a GPU, I need the CUDA toolkit and the NVIDIA driver. To install these dependencies natively on my computer (OS: Ubuntu 18.04) is always quite a pain, as there are …
我在 Windows 10 下使用 Ubuntu 作为客户端操作系统运行Windows 子系统 Linux (WSL)。现在我在 Windows 主机上安装了Docker Desktop,并在 Docker 设置中启用了 WSL 集成。到目前为止一切正常,我可以从我的 WSL Ubuntu 客户端访问在 Windows 主机上运行的 Docker 守护进程。
现在我想知道所有 Docker 卷和其他数据在此设置中存储在哪里。通常这些在 下/var/lib/docker
,但在使用 WSL 时似乎并非如此。运行时,df -h
我可以看到以下与 Docker 相关的行:
/dev/sdd 251G 3.1G 236G 2% /mnt/wsl/docker-desktop-data/isocache
/dev/sdc 251G 120M 239G 1% /mnt/wsl/docker-desktop/shared-sockets
/dev/loop0 244M 244M 0 100% /mnt/wsl/docker-desktop/cli-tools
Run Code Online (Sandbox Code Playgroud)
所以它们似乎在 Windows 主机上的某个地方。
... 但是哪里?
我想获取一些有关正在运行的查询的信息来分析它。在 PgAdmin 3 中,我至少可以使用“解释查询”,而在 DBeaver 中,单击“解释执行计划”后,没有任何反应。
如何获取DBeaver中查询的任何信息?
@编辑
抱歉,如果这个问题看起来太宽泛。我不期望解释如何分析查询,我只是想知道是否可以在 DBeaver 中打开分析器以及如何操作。
I am running a build task in a java project in Visual Studio Code. The warning in the "PROBLEMS" tab:
[myfile].java is a non-project file, only syntax errors are reported
It refers to the first line where I load in the class file containing the main():
package [the project folder];
import [the project folder].[the file with other classes].*;
Run Code Online (Sandbox Code Playgroud)
java project-structure package compiler-warnings visual-studio-code
在 vscode 源代码控制窗格中,我想获取正在运行的会话的任何应用的 git 命令的命令日志,包括所有鼠标单击操作。
例如:
在“初始化存储库”之前:
在“初始化存储库”之后,应记录命令git init
:
等等。
我在 Windows 8.1 上有 conda 4.8.3 和 Python 3.7.4。
我在 conda 环境中安装了 tf 2.0.0。如何升级到 2.2.x?
或者,我如何在 conda 环境中安装 2.2.x?
编辑 1: pip install --upgrade tensorflow 说: Requirement already up-to-date: tensorflow in d:\anaconda3\envs\tf2\lib\site-packages (2.1.0)
但是 tf 版本仍然是 2.0。
编辑 2:conda install tensorflow==2.2.0 说:
PackagesNotFoundError: The following packages are not available from current channels:
Run Code Online (Sandbox Code Playgroud)
我在这里确实有一些运气。
编辑3:
(tf2) D:\ray\dev\covid-19>conda list -n tf2
# packages in environment at D:\Anaconda3\envs\tf2:
#
# Name Version Build Channel
_anaconda_depends 2019.03 py37_0
_ipyw_jlab_nb_ext_conf 0.1.0 py37_0 …
Run Code Online (Sandbox Code Playgroud) 我只是在 Docker for Windows 上试用 WSL 2,但我在安装卷时遇到了问题:
version: "3.7"
services:
node:
build: .
container_name: node
hostname: node
volumes:
- ./app:/app
stdin_open: true
Run Code Online (Sandbox Code Playgroud)
容器构建并启动良好,我使用 docker exec 很好地访问它,但/app
容器内的文件夹未绑定到我的笔记本电脑app
文件夹。但是,正确的路径实际上已正确安装在正在运行的容器上:
(这里我在主机上执行密码,如果它与容器上安装的内容完美匹配)
? app pwd
/mnt/c/Users/willi/devspace/these/app
Run Code Online (Sandbox Code Playgroud)
这是 portainer 的屏幕,它告诉我在容器中安装了哪些路径并且一切都匹配。
我在主机上的 app 文件夹中创建的文件在容器的 app 文件夹中不可见,反之亦然。这很奇怪,我不知道如何调试它。
补充资料:
docker version
WSL 中的输出:19.03.12docker-compose version
: 1.26.2谢谢
docker docker-compose docker-volume windows-subsystem-for-linux docker-desktop
docker ×5
anaconda ×2
conda ×2
python ×2
windows-subsystem-for-linux ×2
wsl-2 ×2
dbeaver ×1
git ×1
gpu ×1
java ×1
logging ×1
nvidia ×1
package ×1
pane ×1
postgresql ×1
powershell ×1
python-3.x ×1
service ×1
sql ×1
systemctl ×1
systemd ×1
tensorflow ×1
windows-10 ×1