Last active
September 7, 2021 06:19
-
-
Save abersheeran/4c112f8dc92acaf9714d312b56f3d55a to your computer and use it in GitHub Desktop.
Allow use docker commands in WSL1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo \ | |
"deb [arch=amd64 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 | |
sudo apt-get update | |
sudo apt-get install -y docker-ce-cli | |
echo -e "\n# For docker cli\nexport DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment