FROM golang:1.10 as build WORKDIR /go/src/pwman RUN go get -d -v gopkg.in/ldap.v2 github.com/gorilla/csrf gopkg.in/jcmturner/gokrb5.v5/client gopkg.in/jcmturner/gokrb5.v5/config github.com/namsral/flag COPY *.go ./ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o pwman . FROM alpine:latest RUN apk --no-cache add ca-certificates WORKDIR /opt COPY --from=build /go/src/pwman/pwman /usr/local/bin/ COPY create-kdc-principal.pl . COPY krb5.conf . COPY static static COPY templates templates CMD ["pwman"]