Skip to content

Commit

Permalink
Fixed docker file to use vendoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Guranda committed Mar 22, 2017
1 parent 3abc6f2 commit 9f1ac9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ ENV SOURCE_DIR /relations-api-src

COPY *.go *.git $SOURCE_DIR/
COPY relations/*.go $SOURCE_DIR/relations/
COPY vendor/vendor.json $SOURCE_DIR/vendor/

RUN apk add --no-cache --update bash ca-certificates \
&& apk --no-cache --virtual .build-dependencies add git go libc-dev \
&& cd $SOURCE_DIR \
&& export GOPATH=/gopath \
&& go get -u github.com/kardianos/govendor \
&& $GOPATH/bin/govendor sync \
&& BUILDINFO_PACKAGE="github.com/Financial-Times/service-status-go/buildinfo." \
&& VERSION="version=$(git describe --tag --always 2> /dev/null)" \
&& DATETIME="dateTime=$(date -u +%Y%m%d%H%M%S)" \
Expand All @@ -19,10 +17,13 @@ RUN apk add --no-cache --update bash ca-certificates \
&& BUILDER="builder=$(go version)" \
&& LDFLAGS="-X '"${BUILDINFO_PACKAGE}$VERSION"' -X '"${BUILDINFO_PACKAGE}$DATETIME"' -X '"${BUILDINFO_PACKAGE}$REPOSITORY"' -X '"${BUILDINFO_PACKAGE}$REVISION"' -X '"${BUILDINFO_PACKAGE}$BUILDER"'" \
&& cd .. \
&& export GOPATH=/gopath \
&& go get -u github.com/kardianos/govendor \
&& REPO_PATH="github.com/Financial-Times/relations-api" \
&& mkdir -p $GOPATH/src/${REPO_PATH} \
&& cp -r $SOURCE_DIR/* $GOPATH/src/${REPO_PATH} \
&& cd $GOPATH/src/${REPO_PATH} \
&& $GOPATH/bin/govendor sync \
&& go get ./... \
&& echo ${LDFLAGS} \
&& go build -ldflags="${LDFLAGS}" \
Expand Down

0 comments on commit 9f1ac9e

Please sign in to comment.