Install Ubuntu from the microsoft app store.
There's some weird things with pathing, by default, all drives including C
are mounted in /mnt
but for docker (and other things) to play nice we need to change c to be mounted in /
- edit the /etc/wsl.conf
(sudo)
sudo vim /etc/wsl.conf
This file should look like this.
[automount]
root = /
options = "metadata"
This installs all the build requirements i have - including docker and pyenv, you may not need all of this
sudo apt update
sudo apt upgrade
sudo apt-get install -y docker make wget curl build-essential libssl-dev \
zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl gnupg2 pass
You need to run docker on windows and "proxy" docker calls from WSL to windows daemon.
Install docker for windows
In docker for windows config, tick "expose daemon on tcp://localhost:2375 without TLS".
Install docker (above)
Now you need to point the WSL docker to the one running on windows:
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc
At this point, we should be completely configured but because you're running windows and containers and micro-instances and all sorts of confusion, you should reboot your machine.
Once rebooted, run this in WSL
docker version
In my WSL instance I get:
Client:
Version: 18.09.5
API version: 1.39
Go version: go1.10.4
Git commit: e8ff056
Built: Thu May 9 23:11:19 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
If this command runs at all, docker is working.
You should also be able to see the root of your C drive by doing this:
ls /c/
If not, your /etc/wsl.conf
may not be configured correctly.
Getting git to play nice for both sides is a bit of a trick WSL and windows don't support all the same file attributes... which sucks... especially with folders, also for some reason by default all line endings on windows should be crlf
apparently...
If you aren't doing much windows development, run this in all terminals to prevent git from changing the line endings:
- WSL terminal
- Gitbash terminal
- Windows command prompt
- powershell
- powershell.* (for good measure)
To better navigate the mixed mac/linux/windows dev environments, make sure your IDE's do not use crlf
and use only lf
- code pushes the line endings sometimes.
git config --global core.autocrlf false
git config --global core.eol lf
# also if you don't want that pesky execute attribute goin awry
git config --global core.fileMode false
By default, wsl/ubuntu has python2.7.x as it's default python instance. removing the default python instance is not a good idea and changing the defaults to python 3 is also a bad idea....
To get around this, I want to use pyenv sourced from here
were all installed up the page!
curl https://pyenv.run | bash
put this in your ~/.profile
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.7.4
pyenv global 3.7.4
Before we get too far, install AWS cli. If you already have awscli installed as an operatign system package - aka via apt - use the OS package.
sudo apt install awscli
if you don't, use the pip installation (it's usually more current).
pip install awscli
Stackup is useful for deploying stacks JQ is useful for json respones
sudo gem install stackup
sudo apt install jq
- [SSH and autostarting] (https://gist.github.com/dentechy/de2be62b55cfd234681921d5a8b6be11)
- [Docker on WSL] (https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly)
Other useful links
- getting rid of the windows photo app - I just don't like it
- Windows Photo Viewer on win 10 - I got used to the mac's lightweight preview feature
- MiniKube stuff
- More MiniKube
- More MiniKube