Skip to content

Commit

Permalink
updates for automated docker hub builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronhurt committed Nov 10, 2016
1 parent 309463e commit 6ae83e0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
1 change: 1 addition & 0 deletions .dockerignore
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:latest
ENV GOPATH /opt/go
ENV SRCPATH $GOPATH/src/github.com/myENA/consul-backinator
COPY . $SRCPATH
RUN \
apk add --no-cache --no-progress ca-certificates go git bash && \
mkdir -p $GOPATH/bin && \
export PATH=$GOPATH/bin:$PATH && \
cd $SRCPATH && \
chmod +x build/build.sh && \
build/build.sh -i && \
mv consul-backinator /usr/local/bin/consul-backinator && \
apk del --no-cache --no-progress --purge go git bash && \
rm -rf $GOPATH /tmp/* /root/.glide
ENTRYPOINT ["/usr/local/bin/consul-backinator"]
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ check:
clean:
@build/build.sh -d

docker: release
$(sudo) docker build -t $(IMAGE_PATH):$(RELEASE_VERSION) -f build/docker . && \
$(sudo) docker tag $(IMAGE_PATH):$(RELEASE_VERSION) $(IMAGE_PATH):latest
docker:
$(sudo) docker build -t $(IMAGE_PATH):latest .

docker_release: docker
$(sudo) docker push $(IMAGE_PATH):$(RELEASE_VERSION) && \
$(sudo) docker push $(IMAGE_PATH):latest
docker_release:
$(sudo) docker build -t $(IMAGE_PATH):latest .
$(sudo) docker tag $(IMAGE_PATH):latest $(IMAGE_PATH):$(RELEASE_VERSION)
4 changes: 2 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ else
printf "Building ... "

## build it
go build -o "${BUILD_NAME}" \
-ldflags="-X main.appVersion=${RELEASE_VERSION}"
CGO_ENABLED=0 go build -o "${BUILD_NAME}" \
-ldflags="-X main.appVersion=${RELEASE_VERSION} -s -w"

## go build return
RETVAL=$?
Expand Down
8 changes: 0 additions & 8 deletions build/docker

This file was deleted.

0 comments on commit 6ae83e0

Please sign in to comment.