Open dhirschfeld opened 2 years ago
sudo usermod -aG docker $USER
Need to do magic to find correct $USER
DOCKER_DIR=/mnt/wsl/shared-docker
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
sudo mkdir /etc/docker/
sudo tee /etc/docker/daemon.json << EOF
{
"hosts": ["unix:///mnt/wsl/shared-docker/docker.sock"]
}
EOF
Necessary startup script:
❯ cat /etc/profile.d/07-docker-daemon.sh
DOCKER_DISTRO="Ubuntu-22.04"
DOCKER_DIR=/mnt/wsl/shared-docker
DOCKER_SOCK="$DOCKER_DIR/docker.sock"
export DOCKER_HOST="unix://$DOCKER_SOCK"
if [ ! -S "$DOCKER_SOCK" ]; then
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
/mnt/c/Windows/System32/wsl.exe -u root -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null > $DOCKER_DIR/dockerd.log 2>&1"
fi
Necessary env-var:
export DOCKER_HOST="unix:///mnt/wsl/shared-docker/docker.sock"
Probably?
Currently, testing the version blows up: