- Scoop [OPTIONAL]. Will be used below for installing several tools.
- Go Programming Language -
scoop install go.
- Bash: either using Git Bash or Busybox for Windows -
scoop install busybox.
- Powershell (It comes with Windows. You can use cmd if you want but you’ll have to adjust the commands yourself).
To install go, I used Scoop with
scoop install go(yes, it’s that easy! Its like homebrew but for Windows), or you can download their installer if you please.
Once installed, you should be able to run
go versionfrom the command line (I’m using Powershell) to see the following:
go version go1.4.1 windows/amd64
Set Go Environment Variable
We need to set the
GOPATHenvironment variable for the go install directory:
$env:homepath\AppData\Local\scoop\apps\go\1.4.1(the last part will depend on your go version from the command above).
In Powershell set it by running
$env:GOPATH="path/to/go"for example in my case it was
$envin Powershell only lasts for the Powershell session. It would be wise to add
GOPATHas a permanent envir
Lets change directories to the GOPATH before we mangle it later.
Get The Docker Source
From the command line you need to run
go get github.com/docker/dockerwhich will download the docker source into your go code library.
There are also a couple of other environment variables required for compiling docker:
$env:DOCKER_CLIENTONLY=1 # This is the mangling of the GOPATH that I was talking about $env:GOPATH="$env:GOPATH\src\github.com\docker\docker\vendor;$env:GOPATH"
Notice that we extended
GOPATHvariable, paying particular attention to the order of the path, which places the vendor directory before the original
For this step you’ll need a copy of Bash. If you use GitHub for Windows, you can use Git Bash, or if you have Scoop, you can run
scoop install busyboxwhich comes with Bash.
Then run the following:
# You should be at the GOPATH directory at this point cd src\github.com\docker\docker bash .\project\make\.go-autogen
Finally, Compile Docker
# You're already at GOPATH\src\github.com\docker\docker # But we need to go deeper! cd docker go build -v
You should then have a nice new
docker.exefile in the current directory. You can add this directory to your
PATHor alternatively run
shim ./docker.exeif you have shim from scoop installed (
scoop install shim).
Silvrback blog image
You still need a Virtual Machine interface like Boot2Docker or docker-machine. Having the docker client doesn’t mean that the docker daemon runs on Windows yet.
If you configure
DOCKER_HOSTto point to your docker instance (whether on a server or running in a VM) you can now use the docker client natively on Windows to interface with it.