Sync secrets from a 1Password vault into Kubernetes secrets.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
857 B

FROM golang:1.14-alpine AS builder
RUN apk update && apk add --no-cache git curl && adduser -D -g '' gopher && apk add -U --no-cache ca-certificates
RUN curl -o
RUN unzip && mv ./op /usr/local/bin && chmod +x /usr/local/bin/op
ADD go.mod go.sum ./
RUN go mod download
ADD . .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o kube-1password-secrets main.go
FROM golang:1.14-alpine
COPY --from=builder /usr/local/bin/op /usr/local/bin/op
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /app/kube-1password-secrets /app/kube-1password-secrets
RUN mkdir -p /root/.op && chmod 700 /root/.op
ENTRYPOINT ["/app/kube-1password-secrets"]