Download setup for Docker CE Windows.
Install it.
Go to seetings and check expose daemon.
Open Powershell and run :
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Restart when prompted.
Open the Microsoft Store and choose your favorite Linux distribution.
Choose the distro you want and click get
Open WSL Bash
terminal (Start menu -> search for "bash"), or
Press Win+R, paste C:\Windows\System32\bash.exe
, then click ok
https://docs.docker.com/engine/install/
Connect to a remote Docker daemon with this 1 liner:
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc
You should get a bunch of output about your Docker daemon. If you get a permission denied error, close + open your terminal and try again.
docker info
You should get back your Docker Compose version.
docker-compose --version
sudo mkdir /c
sudo mount --bind /mnt/c /c
sudo mkdir /d
sudo mount --bind /mnt/d /d
This is made so that docker can translate linux paths to windows paths. (/c/path/to/dir
to C:/path/to/dir
), otherwise the mount points in wsl will be /mnt/c/
and docker will not find MNT:/c
Set umask to 0022
umask 022 >> ~/.profile
Edit /etc/wsl.conf
sudo nano /etc/wsl.conf
Contents should be:
[automount]
enabled = true
root = /
options = "uid=1000,gid=1000,umask=0022,metadata"
Download desired version from the download page.
Run the setup.
Create folders D:\work\go\
D:\work\go\win\bin
D:\work\go\src
Open "Control pannel", go to "System" then "Advanced system settings", then click on the "Environment Variables" button on the bottom of the window and add these new variables to the your user.
GOPATH=D:\work\go\
GOBIN=D:\work\go\win\bin
Optional you can add you windows gobin to the windows PATH variable.
Go to go download page to get the link to the latest go version.
Download desired verison with wget:
wget https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz
Install under /usr/local
:
tar -C /usr/local -xzf go1.13.6.linux-amd64.tar.gz
Export vars in ~/.profile
:
mkdir /d/work/go/lin/bin
echo "export GOPATH=/d/work/go" >> ~/.profile
echo "export GOBIN=/d/work/go/linux/bin" >> ~/.profile
echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=direct" >> ~/.profile
echo "export GOSUMDB=off" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOBIN" >> ~/.profile
source ~/.profile
cd ~
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
. ~/git-completion.bash >> ~/.bashrc
Download Visual Studio Code and install it.
Open VS Code.
Press Ctrl+Shift+P
in VS Code and type in Extensions: Install Extensions
which will open a pannel on the right side.
Search for Go Extension
Install it and reload the window.
Press Ctrl+,
in VS Code , this will open the settings, and search for Shell: Windows
and in the first field replace C:\Windows\System32\cmd.exe
with C:\windows\sysnative\bash.exe
Press Ctrl+Shift+P
in VS Code and type in Go: Install/Update Tools
wait for VS Code to install necessary go tools.
Warning: Do not install VS Code for WSL Extension
because it will cause issues with docker created files. VS Code will use WSL file update events to update files, which will give false files when creating them from docker, which cannot be deleted or overwritten, and they will give you headaches.