Skip to content

Commit

Permalink
Add Dockerfile and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
PrasadG193 committed Dec 26, 2018
1 parent 05fe517 commit 8122af0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM golang:1.11-alpine

RUN mkdir -p /go/src/app
WORKDIR /go/src/app

CMD ["/controller"]

RUN mkdir -p /go/src/github.com/infracloudio/kubeops/vendor && \
mkdir -p /go/src/github.com/infracloudio/kubeops/cmd && \
mkdir -p /go/src/github.com/infracloudio/kubeops/pkg

COPY vendor/ /go/src/github.com/infracloudio/kubeops/vendor
COPY cmd/ /go/src/github.com/infracloudio/kubeops/cmd
COPY pkg/ /go/src/github.com/infracloudio/kubeops/pkg


RUN cd /go/src/github.com/infracloudio/kubeops/cmd/controller && \
go build && \
cp /go/src/github.com/infracloudio/kubeops/cmd/controller/controller /controller
9 changes: 9 additions & 0 deletions build/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set +x

BUILD_ROOT=$(dirname $0)
IMAGE_REPO=${1:-infracloud/kubeops}
IMAGE_TAG=${2:-latest}

pushd ${BUILD_ROOT}/..
docker build -t $IMAGE_REPO:$IMAGE_TAG -f ${BUILD_ROOT}/build/Dockerfile --no-cache .
popd

0 comments on commit 8122af0

Please sign in to comment.