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