Skip to content

Commit

Permalink
Add build-image folder, which allows to build kube-router on mac os
Browse files Browse the repository at this point in the history
  • Loading branch information
thoro committed Aug 20, 2017
1 parent 72fd0d2 commit cb0888b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from centos:7

RUN yum -y install git make

ENV GO_VERSION 1.8.3
ENV GO_OS linux
ENV GO_ARCH amd64

RUN curl -O -L https://storage.googleapis.com/golang/go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz && \
tar -C /usr/local -xzf go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz && \
mkdir -p /data/go && \
export GOPATH=/data/go

COPY entrypoint.sh /bin/

VOLUME [ "/data/go" ]

ENTRYPOINT [ "entrypoint.sh" ]
6 changes: 6 additions & 0 deletions build-image/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/bash

export GOPATH=/data/go
export PATH=$PATH:/usr/local/go/bin
cd /data/go/src/github.com/cloudnativelabs/kube-router
make "$@"
4 changes: 4 additions & 0 deletions build-image/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NAME=kube-router-build
docker build -t kube-router-build:latest .
docker rm -f $NAME
docker run --name=$NAME -v $GOPATH:/data/go kube-router-build:latest

0 comments on commit cb0888b

Please sign in to comment.