First step, start with a local WSL
First, install Docker, but the Docker service cannot start and gives me an error:
Err :connection error: desc = "transport: Error while dialing dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting... module=grpc
failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add return rule in DOCKER-ISOLATION-STAGE-1 chain: (iptables failed: iptables --wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN: iptables v1.8.7 (nf_tables): RULE_APPEND failed (No such file or directory): rule in chain DOCKER-ISOLATION-STAGE-1
(exit status 4))
After my careful search, it needs to be done like this:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
Then it works fine.
Next, run Siyuan.
To preserve data, you need to map a folder, like this:
docker run -v /root/siyuan/:/siyuan/workspace -p 6806:6806 -u 1000:1000 b3log/siyuan --workspace=/siyuan/workspace/
But if it gives an error:
create conf folder [/siyuan/workspace/conf] failed: mkdir /siyuan/workspace/conf: permission denied
It means that the mapped folder outside the container does not have sufficient permissions (I don't know why, isn't it root?). Just use chmod 777.
And now, let me introduce my 30-year-old server:
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:75: mounting "proc" to rootfs at "/proc" caused: mount through procfd: permission denied: unknown.
ERRO[0020] error waiting for container: context canceled
Damn it, this server running on LXC can't run Docker.