From 1306d02dadf6e64d7531b177bf789e70ab3a59c9 Mon Sep 17 00:00:00 2001 From: Eugene Dementiev Date: Thu, 17 May 2018 16:36:07 +1200 Subject: [PATCH] Add Docker builder --- .dockerignore | 3 +++ Dockerfile.build | 13 +++++++++++++ build.sh | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.build create mode 100755 build.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6b9ad26 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +vendor/ +Dockerfile.build +build.sh diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..5812c42 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,13 @@ +FROM golang:1.10-alpine as build + +RUN apk update && apk add git +RUN go get -u github.com/golang/dep/cmd/dep + +WORKDIR /go/src/github.com/springload/ssm-parent + +ADD Gopkg.lock Gopkg.toml ./ + +RUN dep ensure -vendor-only + +ADD ./ ./ +RUN go build diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..b01f217 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +docker build -t ssm-parent -f Dockerfile.build . +docker run --rm -v "$(pwd):/tmp/builder" ssm-parent cp ssm-parent /tmp/builder