Ubuntu Docker Source code compilation (1.9.1) detailed _docker

Source: Internet
Author: User
Tags mkdir git clone docker run

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.