Ubuntu Docker source code compilation:
On the internet to the Ubuntu Docker source code compiled a lot of information, but for the specific how to operate, and the implementation of the command is not much meticulous, after my toss, finally the source code compiled, here record, in order to use the reference later,
First, the system environment
Ubuntu14.04 Desktop 64-bit
Second, install Docker (Docker compile Docker)
$ sudo apt-get update
$ sudo apt-get install wget
$ wget-qo-https://get.docker.com/| Sh
Third, pull Docker development environment container
# Docker Pull docker-dev:1.9.1
Four, download Docker source to the local machine
# apt-get install git
# mkdir-p/home/docker/src
# cd/home/docker/src
# git clone https://github.com/docker /docker.git
# cd Docker
# git checkout v1.9.1
Five, compile
In fact, Docker compile the container with the source code, here the fourth step to download the source to the local machine, mainly for two times the development of convenience.
You can replace the original code in the container with the new code you have developed, and make custom development.
1. Create local compilation Results Save directory
# mkdir-p/home/docker/bundles
2. Start the container and map the local code to the container:
# docker run--rm-it--privileged \
e buildflags \
e docker_clientonly \
e docker_execdriver \
e DOCK Er_experimental \
e docker_graphdriver \
e docker_storage_opts \
e docker_userlandproxy \
E Testdirs-e testflags \
e TIMEOUT \
-v/home/docker/bundles:/go/src/github.com/docker/docker/bundles \
-v/home/docker/src:/tmp \
docker-dev:1.9.1 \
Bash
3. Compile in container ( This command executes in container ):
# cp-a/tmp/docker/*/go/src/github.com/docker/docker/
# hack/make.sh Binary
4. After the compilation completes, Exits the container, examines the local result path, has generated compiles the Docker executable file:
# ls-l/home/docker/bundles
Vi. Verification
# cd/home/docker/bundles/1.9.1/binary
#./docker version
Thank you for reading, I hope to help you, thank you for your support for this site!