Docker/Docker in WSL: Difference between revisions

From Omnia
Jump to navigation Jump to search
No edit summary
Line 26: Line 26:


Ref: [https://www.paulsblog.dev/how-to-install-docker-without-docker-desktop-on-windows/]
Ref: [https://www.paulsblog.dev/how-to-install-docker-without-docker-desktop-on-windows/]
Additional steps: (doesn't seem to start docker automatically)
<pre>
# 6. Start Docker:
sudo service docker start
sudo service docker status
sudo docker ps
</pre>

Revision as of 02:36, 15 May 2024

Docker in WSL

#/bin/bash

# 1. Required dependencies
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release

# 2. GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# 3. Use stable repository for Docker
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# 4. Install Docker
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io

# 5. Add user to docker group
sudo groupadd docker
sudo usermod -aG docker $USER

Ref: [1]

Additional steps: (doesn't seem to start docker automatically)

# 6. Start Docker:
sudo service docker start
sudo service docker status

sudo docker ps