diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b80ab83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.12-alpine as build + +RUN apk update && apk add git + +WORKDIR /app + +ADD go.mod go.sum ./ + +RUN go mod download + +ADD ./ ./ +ENV CGO_ENABLED=0 +RUN go build + +FROM alpine as runtime + +COPY --from=build /app/ssm-parent /usr/bin + +ENTRYPOINT ["/usr/bin/ssm-parent"] diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index 1668bc8..0000000 --- a/Dockerfile.build +++ /dev/null @@ -1,13 +0,0 @@ -FROM golang:1.11-alpine as build - -RUN apk update && apk add git - -WORKDIR /app - -ADD go.mod go.sum ./ - -RUN go mod download - -ADD ./ ./ -ENV CGO_ENABLED=0 -RUN go build diff --git a/build.sh b/build.sh deleted file mode 100755 index b01f217..0000000 --- a/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker build -t ssm-parent -f Dockerfile.build . -docker run --rm -v "$(pwd):/tmp/builder" ssm-parent cp ssm-parent /tmp/builder