Skip to content

Instantly share code, notes, and snippets.

@nanikjava
Created April 2, 2018 01:21
Show Gist options
  • Save nanikjava/01a375db38ab1c91c666663640178cce to your computer and use it in GitHub Desktop.
Save nanikjava/01a375db38ab1c91c666663640178cce to your computer and use it in GitHub Desktop.
Building Docker & GoLang
building golang
----------------
* download go1.4 as bootstrap and put it somewhere
* put go1.4 directory into GOROOT_BOOTSTRAP like follows
export GOROOT_BOOTSTRAP="/media/nanik/SeagateExpansionDrive/OpenSourceProject/Docker/go14"
* go inside src directory and use the following command
./make.bash
* once build process is complete following message will show
Installed Go for linux/amd64 in /media/nanik/SeagateExpansionDrive/OpenSourceProject/Docker/gomaster
Installed commands in /media/nanik/SeagateExpansionDrive/OpenSourceProject/Docker/gomaster/bin
* references
- https://www.digitalocean.com/community/tutorials/how-to-build-go-from-source-on-ubuntu-16-04
- https://medium.com/@vCabbage/go-testing-standard-library-changes-1e9cbed11339
building docker
--------------
* remove all go in system (sudo apt-get remove golang-go)
* build go from source
* point GOROOT and GOPATH to the newly built go language
* there is a fix that needs to be done inside make.sh inside hack folder. Use the following flag
LDFLAGS_STATIC=''
EXTLDFLAGS_STATIC='-fno-PIC'
* PATH=$PATH:$GOROOT/bin ./hack/make.sh binary-daemon
once complete following msg will show
---> Making bundle: binary-daemon (in bundles/binary-daemon)
Building: bundles/binary-daemon/dockerd-dev
Created binary: bundles/binary-daemon/dockerd-dev
docker binary inside bundles/binary-daemon/ and can be run as ./dockerd-dev
* references
- https://ahmet.im/blog/compiling-docker-cli-on-windows/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment