Skip to content

Commit

Permalink
Add dockerfile for a "calicokube"
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
  • Loading branch information
Bogdan Dobrelya committed Jul 8, 2016
1 parent f333505 commit 60626e3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:jessie
MAINTAINER projectcalico

RUN mkdir -p /opt/cni/bin
ADD ./dist/calico /opt/cni/bin
ADD ./dist/calico-ipam /opt/cni/bin
VOLUME /opt/cni
ENV PATH=$PATH:/opt/cni/bin
WORKDIR /opt/cni/bin
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

# Version of calico/build to use.
BUILD_VERSION=latest
CALICO_VERSION=$(shell git describe --tags)

SRCFILES=$(shell find calico_cni -type f ! -path calico_cni/version.py) calico.py ipam.py
LOCAL_IP_ENV?=$(shell ip route get 8.8.8.8 | head -1 | cut -d' ' -f8)

K8S_VERSION=1.2.0

default: all
all: binary test
all: docker test
binary: update-version dist/calico dist/calico-ipam
docker: binary dist/docker
test: ut fv
plugin: dist/calico
ipam: dist/calico-ipam
Expand All @@ -30,11 +32,16 @@ dist/calico-ipam: $(SRCFILES)
calico/build:$(BUILD_VERSION) \
pyinstaller ipam.py -ayF -n calico-ipam

# Makes a docker image
dist/docker:
docker build -t calico/cni .
docker tag calico/cni calico/cni:$(CALICO_VERSION)

# Updates the version information in version.py
update-version:
echo "# Auto-generated contents. Do not manually edit" > calico_cni/version.py
echo "# or check in this file." >> calico_cni/version.py
echo "__version__ = '$(shell git describe --tags)'" >> calico_cni/version.py
echo "__version__ = '${CALICO_VERSION}'" >> calico_cni/version.py
echo "__commit__ = '$(shell git rev-parse HEAD)'" >> calico_cni/version.py
echo "__branch__ = '$(shell git rev-parse --abbrev-ref HEAD)'" >> calico_cni/version.py

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ To build the Calico Networking Plugin for CNI locally, clone this repository and
- To just build the binaries, with no tests, run `make binary`. This will produce `dist/calico` and `dist/calico-ipam`.
- To only run the unit tests, simply run `make ut`.
- To only run the fv tests, simply run `make fv`.
- To build the docker image, run `make docker`.

[cni]: https://github.com/appc/cni
[config]: configuration.md
Expand Down

0 comments on commit 60626e3

Please sign in to comment.