ShadowPower
2023-08-05 10:27:53 +08:00
我在 2017 年的时候整的方案:
装 Hyper-V 上,用 WSL 1
.bashrc 里这样配置:
# connent to Docker for Windows
export DOCKER_HOST=tcp://127.0.0.1:2375
# mount /mnt/c to /c if not already done
if [ ! -d "/c" ] || [ ! "$(ls -A /c)" ]; then
sudo mkdir -p /c
sudo mount --bind /mnt/c /c
fi
if [ ! -d "/d" ] || [ ! "$(ls -A /d)" ]; then
sudo mkdir -p /d
sudo mount --bind /mnt/d /d
fi
# 其他磁盘分区以此类推……
# Change from /mnt/c/... to /c/...
if [ "$(pwd | cut -c -7)" == "/mnt/c/" ] || [ "$(pwd | cut -c -7)" == "/mnt/d/" ]; then
cd "$(pwd | cut -c 5-)"
fi