Installing Docker on Pengwin without Docker Desktop #734
Answered
by
crramirez
avinashupadhya99
asked this question in
Q&A
-
|
Hello, I am trying to install docker on Pengwin without Docker Desktop. Is the process documented anywhere? I would really appreciate any help with this. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
crramirez
Feb 17, 2022
Replies: 2 comments 8 replies
-
|
Hello @avinashupadhya99, No. I'll assemble one and paste it here. Maybe then we can add this to pengwin-setup. Regards, |
Beta Was this translation helpful? Give feedback.
0 replies
-
How to install docker in Pengwin without Docker Desktopsudo apt update
sudo apt install -y --no-install-recommends gnupg2source /etc/os-release
curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt updatesudo apt install -y docker-ce docker-ce-cli containerd.iosudo usermod -aG docker $USERDOCKER_DIR=/mnt/wsl/shared-docker
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
sudo chgrp docker "$DOCKER_DIR"
sudo mkdir /etc/dockersudo <your_text_editor> /etc/docker/daemon.json{
"hosts": ["unix:///mnt/wsl/shared-docker/docker.sock"],
"iptables": false
}sudo <your_text_editor> /etc/profile.d/docker.sh#! bin/sh
DOCKER_DISTRO="${WSL_DISTRO_NAME}"
DOCKER_DIR=/mnt/wsl/shared-docker
DOCKER_SOCK="$DOCKER_DIR/docker.sock"
export DOCKER_HOST="unix://$DOCKER_SOCK"
connected=$(docker version 2>&1 | grep -c "daemon\|error")
if [ ${connected} != 0 ]; then
rm -f "${DOCKER_SOCK}"
fi
unset connected
if [ ! -S "$DOCKER_SOCK" ]; then
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
/mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd </dev/null > $DOCKER_DIR/dockerd.log 2>&1"
fiecho "%docker ALL=(ALL) NOPASSWD: /usr/bin/dockerd" | sudo EDITOR='tee -a' visudo --quiet --file=/etc/sudoers.d/dockerdCOMPOSE_VERSION=1.29.2
sudo curl -L "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-composeRestart Pengwin Steps fromhttps://dev.solita.fi/2021/12/21/docker-on-wsl2-without-docker-desktop.html |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
avinashupadhya99
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to install docker in Pengwin without Docker Desktop
sudo usermod -aG docker $USER{ "hosts": ["unix:///mnt/wsl/shared-docker/docker.sock"],