Skip to content

Instantly share code, notes, and snippets.

@ivawzh
Last active October 4, 2018 13:56
Show Gist options
  • Save ivawzh/a2e58d2cda03b6ccd854203ec3984752 to your computer and use it in GitHub Desktop.
Save ivawzh/a2e58d2cda03b6ccd854203ec3984752 to your computer and use it in GitHub Desktop.
setup Docker on bash on Ubuntu on Windows 10

Setup Docker on bash on Ubuntu on Windows 10

Steps:

A. On Windows side

  1. Make sure Windows version is at least Professional. Or follow this to upgrade. Note Windows upgrade is a piece of shit. Only hope is restart OS when you think upgrade stucks.
  2. https://docs.docker.com/docker-for-windows/install/ download Docker edge, install it with Hyper-V. Do not use VirtualBox, it does not work with bash.
  3. start Docker.exe

B. On Bash side

  1. install brew on linux http://linuxbrew.sh/
  2. brew install docker
  3. echo -n "export DOCKER_HOST=tcp://0.0.0.0:2375" >> ~/.zshrc

How this works

Docker engine is still running on Windows side. Just bash's Docker client connects to Windows' Docker engine. Therefore, you are still counting on luck that Docker with Hyper-V would behave the same as Docker on real Linux.

Known Docker-Compose problem

See empty folder in shared volumn with Docker-Compose.

Solution:

$ sudo mkdir /c
$ sudo mount --bind /mnt/c /c
$ cd /c/path/to/project
$ docker-compose ...

Ref https://github.com/aseering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment