Skip to content

Commit

Permalink
Merge pull request #7 from stakater/update-dockerfile
Browse files Browse the repository at this point in the history
[STK-114] Add bootstrap.sh and update dockerfile
  • Loading branch information
hazim1093 authored Feb 27, 2018
2 parents fa39f2e + a8ccc43 commit 182d8c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ LABEL author="stakater"
ARG SRC_DIR="ingress-monitor-controller"
ENV SRC_DIR=${SRC_DIR}

ADD bootstrap.sh /bootstrap.sh

ADD ./src /go/${SRC_DIR}
RUN cd ${SRC_DIR} && \
glide update && \
cp -r ./vendor/* /go/src/ && \
go test && \
go build -o ./out/main

CMD [ "/bin/sh", "-c", "${SRC_DIR}/out/main" ]
CMD [ "/bin/sh", "-c", "/bootstrap.sh" ]
18 changes: 18 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh

cd ${SRC_DIR}

echo "Fetching dependencies"
glide update

echo "Copying dependencies to GOPATH"
cp -r ./vendor/* /go/src/

echo "Running Tests"
go test && \

echo "Building the controller"
go build -o ./out/main

echo "Running the controller"
./main

0 comments on commit 182d8c4

Please sign in to comment.