Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArchWSL下安装使用docker #7

Open
maboloshi opened this issue Feb 26, 2020 · 2 comments
Open

ArchWSL下安装使用docker #7

maboloshi opened this issue Feb 26, 2020 · 2 comments

Comments

@maboloshi
Copy link
Owner

maboloshi commented Feb 26, 2020

pacman -S docker

ArchWSL下无法使用systemctl运行docker daemon

运行systemctl start docker 提示:

System has not been booted with systemd as init system (PID 1). Can't operate.

解决方法 yuk7/ArchWSL#20 (comment)

pacman -S python
# 安装 systemctl 替换版本
mv /usr/bin/systemctl /usr/bin/systemctl.old
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py > /usr/bin/systemctl
chmod +x /usr/bin/systemctl
systemctl enable docker
systemctl status docker
docker.service - Docker Application Container Engine 
    Loaded: loaded (/usr/lib/systemd/system/docker.service, enabled)
    Active: failed (failed)

激活失败 待解决

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
@stupid-yu
Copy link

[subsystemctl](GitHub - sorah/subsystemctl: Utility to run systemd in WSL2 with a Linux namespace) may help u.

# step 1
wsl -u root -- subsystemctl start

# step 2
sudo pacman -S docker

# step 3
sudo subsystemctl start
sudo subsystemctl exec sudo systemctl start docker
sudo subsystemctl exec sudo systemctl enable docker

@stupid-yu
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants