kanidm/kanidmd/Dockerfile.scratch
Pando85 7687791466 Merge docker image github actions into unique
Use matrix and Makefile to build both images in the same workflow.

Kanidmd image remove muslc version and come back to SUSE version because
performance problems.

Also fix a typo bug with kanidmd image build on CI.
2020-05-07 12:37:14 +10:00

33 lines
938 B
Docker

ARG BASE_IMAGE=ekidd/rust-musl-builder:1.43.0
FROM ${BASE_IMAGE} AS builder
LABEL mantainer william@blackhats.net.au
ADD --chown=rust:rust . ./
WORKDIR kanidmd
RUN cargo build --release
FROM alpine:3.11 AS alpine
LABEL mantainer william@blackhats.net.au
RUN apk --no-cache add ca-certificates
COPY --from=builder \
/home/rust/src/target/x86_64-unknown-linux-musl/release/kanidmd \
/sbin/
EXPOSE 8443
VOLUME /data
CMD ["/sbin/kanidmd", "server", "-D", "/data/kanidm.db", "-C", "/data/ca.pem", \
"-c", "/data/cert.pem", "-k", "/data/key.pem", "--bindaddr", "0.0.0.0:8443"]
FROM scratch
LABEL mantainer william@blackhats.net.au
COPY --from=builder \
/home/rust/src/target/x86_64-unknown-linux-musl/release/kanidmd \
/sbin/
EXPOSE 8443
VOLUME /data
CMD ["/sbin/kanidmd", "server", "-D", "/data/kanidm.db", "-C", "/data/ca.pem", \
"-c", "/data/cert.pem", "-k", "/data/key.pem", "--bindaddr", "0.0.0.0:8443"]