introduce top-level Makefile to build the docker binary
Upstream-commit: 7009d6c6ddc2acc77e7caa227c08ecf29d747298 Component: engine
This commit is contained in:
1
components/engine/.gitignore
vendored
1
components/engine/.gitignore
vendored
@ -9,3 +9,4 @@ command-line-arguments.test
|
||||
.flymake*
|
||||
docker.test
|
||||
auth/auth.test
|
||||
build/
|
||||
|
||||
33
components/engine/Makefile
Normal file
33
components/engine/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
DOCKER_PACKAGE := github.com/dotcloud/docker
|
||||
|
||||
BUILD_DIR := $(CURDIR)/build
|
||||
|
||||
GOPATH ?= $(BUILD_DIR)
|
||||
export GOPATH
|
||||
|
||||
SRC_DIR := $(GOPATH)/src
|
||||
|
||||
DOCKER_DIR := $(SRC_DIR)/$(DOCKER_PACKAGE)
|
||||
DOCKER_MAIN := $(DOCKER_DIR)/docker
|
||||
|
||||
DOCKER_BIN := $(CURDIR)/bin/docker
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(DOCKER_BIN)
|
||||
|
||||
$(DOCKER_BIN): $(DOCKER_DIR)
|
||||
@mkdir -p $(dir $@)
|
||||
(cd $(DOCKER_MAIN); go get; go build -o $@)
|
||||
|
||||
$(DOCKER_DIR):
|
||||
@mkdir -p $(dir $@)
|
||||
@ln -sf $(CURDIR)/ $@
|
||||
|
||||
clean:
|
||||
@rm -rf $(dir $(DOCKER_BIN))
|
||||
ifeq ($(GOPATH), $(BUILD_DIR))
|
||||
@rm -rf $(BUILD_DIR)
|
||||
else ifneq ($(DOCKER_DIR), $(realpath $(DOCKER_DIR)))
|
||||
@rm -f $(DOCKER_DIR)
|
||||
endif
|
||||
@ -53,6 +53,22 @@ Under the hood, Docker is built on the following components:
|
||||
Install instructions
|
||||
==================
|
||||
|
||||
Building from source
|
||||
--------------------
|
||||
|
||||
1. Make sure you have a [Go language](http://golang.org) compiler.
|
||||
|
||||
On a Debian/wheezy or Ubuntu 12.10 install the package:
|
||||
|
||||
```bash
|
||||
|
||||
$ sudo apt-get install golang-go
|
||||
```
|
||||
|
||||
2. Execute ``make``
|
||||
|
||||
3. Find your binary in ``bin/docker``
|
||||
|
||||
Installing on Ubuntu 12.04 and 12.10
|
||||
------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user