add root Dockerfile which will build all binaries

This commit is contained in:
Brian Picciano 2019-06-18 00:12:54 -04:00
parent 7a5ac9caa0
commit 6cd61c60f7
3 changed files with 12 additions and 5 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
Dockerfile

11
Dockerfile Normal file
View File

@ -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

View File

@ -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