From 6cd61c60f74b37a7c6b1f9fd2e445bc8c7260239 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 18 Jun 2019 00:12:54 -0400 Subject: [PATCH] add root Dockerfile which will build all binaries --- .dockerignore | 1 + Dockerfile | 11 +++++++++++ cmd/totp-proxy/Dockerfile | 5 ----- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile delete mode 100644 cmd/totp-proxy/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9414382 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..141d13a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.12 AS builder +WORKDIR /app +COPY . . +RUN GOBIN=$(pwd)/bin CGO_ENABLED=0 GOOS=linux go install -a -installsuffix cgo ./cmd/... + +FROM alpine:latest +RUN apk --no-cache add ca-certificates +WORKDIR /app/bin +COPY --from=builder /app/bin /app/bin +ENV PATH="/app/bin:${PATH}" +CMD echo "Available commands:" && ls diff --git a/cmd/totp-proxy/Dockerfile b/cmd/totp-proxy/Dockerfile deleted file mode 100644 index e49ebfe..0000000 --- a/cmd/totp-proxy/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM alpine -RUN apk --update upgrade && apk add curl ca-certificates && \ - update-ca-certificates && rm -rf /var/cache/apk/* -ADD totp-proxy /totp-proxy -CMD /totp-proxy