mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
Docker build fixes (#904)
* Added KANIDM_BUILD_PROFILE to `kanidmd` build Dockerfile
This commit is contained in:
parent
fedc21ddca
commit
534bd9f621
|
@ -1,7 +1,7 @@
|
||||||
# This builds the kanidm CLI tool
|
# This builds the kanidm CLI tool
|
||||||
|
|
||||||
ARG BASE_IMAGE=opensuse/tumbleweed:latest
|
ARG BASE_IMAGE=opensuse/tumbleweed:latest
|
||||||
FROM ${BASE_IMAGE} AS repos
|
FROM ${BASE_IMAGE} AS repos
|
||||||
|
|
||||||
# To help mirrors not be as bad
|
# To help mirrors not be as bad
|
||||||
RUN zypper install -y mirrorsorcerer
|
RUN zypper install -y mirrorsorcerer
|
||||||
RUN /usr/sbin/mirrorsorcerer -x; true
|
RUN /usr/sbin/mirrorsorcerer -x; true
|
||||||
|
@ -9,12 +9,14 @@ RUN zypper refresh --force
|
||||||
RUN zypper dup -y
|
RUN zypper dup -y
|
||||||
|
|
||||||
FROM repos AS builder
|
FROM repos AS builder
|
||||||
|
ARG SCCACHE_REDIS=""
|
||||||
|
ARG KANIDM_FEATURES
|
||||||
|
ARG KANIDM_BUILD_PROFILE
|
||||||
|
ARG KANIDM_BUILD_OPTIONS=""
|
||||||
|
|
||||||
RUN zypper install -y \
|
RUN zypper install -y \
|
||||||
cargo \
|
cargo rust wasm-pack \
|
||||||
gcc \
|
gcc clang lld \
|
||||||
rust wasm-pack \
|
|
||||||
clang lld \
|
|
||||||
make automake autoconf \
|
make automake autoconf \
|
||||||
libopenssl-devel \
|
libopenssl-devel \
|
||||||
pam-devel \
|
pam-devel \
|
||||||
|
@ -26,22 +28,16 @@ RUN zypper clean -a
|
||||||
|
|
||||||
COPY . /usr/src/kanidm
|
COPY . /usr/src/kanidm
|
||||||
|
|
||||||
ARG SCCACHE_REDIS=""
|
|
||||||
ARG KANIDM_FEATURES
|
|
||||||
ARG KANIDM_BUILD_PROFILE
|
|
||||||
ARG KANIDM_BUILD_OPTIONS=""
|
|
||||||
|
|
||||||
RUN mkdir /scratch
|
RUN mkdir /scratch
|
||||||
RUN echo $KANIDM_BUILD_PROFILE
|
RUN echo $KANIDM_BUILD_PROFILE
|
||||||
RUN echo $KANIDM_FEATURES
|
ENV KANIDM_BUILD_PROFILE=${KANIDM_BUILD_PROFILE:-container_generic}
|
||||||
|
RUN echo Features $KANIDM_FEATURES
|
||||||
|
|
||||||
ENV CARGO_HOME=/scratch/.cargo
|
ENV CARGO_HOME=/scratch/.cargo
|
||||||
ENV RUSTFLAGS="-Clinker=clang"
|
ENV RUSTFLAGS="-Clinker=clang"
|
||||||
|
|
||||||
WORKDIR /usr/src/kanidm/
|
|
||||||
|
|
||||||
ENV RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/ld.lld"
|
ENV RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/ld.lld"
|
||||||
|
|
||||||
|
# set up sccache if you've done the thing
|
||||||
RUN if [ "${SCCACHE_REDIS}" != "" ]; \
|
RUN if [ "${SCCACHE_REDIS}" != "" ]; \
|
||||||
then \
|
then \
|
||||||
export CARGO_INCREMENTAL=false && \
|
export CARGO_INCREMENTAL=false && \
|
||||||
|
@ -52,6 +48,7 @@ else \
|
||||||
export CC="/usr/bin/clang"; \
|
export CC="/usr/bin/clang"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
WORKDIR /usr/src/kanidm/
|
||||||
# build the CLI
|
# build the CLI
|
||||||
RUN if [ -z "${KANIDM_FEATURES}" ]; then \
|
RUN if [ -z "${KANIDM_FEATURES}" ]; then \
|
||||||
cargo build -p kanidm_tools --bin kanidm ${KANIDM_BUILD_OPTIONS} \
|
cargo build -p kanidm_tools --bin kanidm ${KANIDM_BUILD_OPTIONS} \
|
||||||
|
@ -82,5 +79,4 @@ RUN zypper remove -y busybox-adduser
|
||||||
|
|
||||||
USER kanidm
|
USER kanidm
|
||||||
|
|
||||||
ENTRYPOINT [ "/sbin/kanidm" ]
|
CMD [ "/sbin/kanidm", "-c", "/data/kanidm.toml" ]
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ RUN /usr/sbin/mirrorsorcerer -x; true
|
||||||
RUN zypper refresh --force
|
RUN zypper refresh --force
|
||||||
RUN zypper dup -y
|
RUN zypper dup -y
|
||||||
|
|
||||||
|
|
||||||
FROM repos AS builder
|
FROM repos AS builder
|
||||||
LABEL maintainer william@blackhats.net.au
|
|
||||||
|
|
||||||
RUN zypper install -y \
|
RUN zypper install -y \
|
||||||
cargo \
|
cargo \
|
||||||
|
@ -25,13 +25,16 @@ COPY . /usr/src/kanidm
|
||||||
|
|
||||||
ARG SCCACHE_REDIS=""
|
ARG SCCACHE_REDIS=""
|
||||||
ARG KANIDM_FEATURES
|
ARG KANIDM_FEATURES
|
||||||
ARG KANIDM_BUILD_PROFILE
|
ARG KANIDM_BUILD_PROFILE="container_generic"
|
||||||
ARG KANIDM_BUILD_OPTIONS=""
|
ARG KANIDM_BUILD_OPTIONS=""
|
||||||
|
|
||||||
RUN mkdir /scratch
|
RUN mkdir /scratch
|
||||||
RUN echo $KANIDM_BUILD_PROFILE
|
RUN echo $KANIDM_BUILD_PROFILE
|
||||||
RUN echo $KANIDM_FEATURES
|
RUN echo $KANIDM_FEATURES
|
||||||
|
|
||||||
|
# Set the build profile
|
||||||
|
ENV KANIDM_BUILD_PROFILE="${KANIDM_BUILD_PROFILE}"
|
||||||
|
|
||||||
ENV CARGO_HOME=/scratch/.cargo
|
ENV CARGO_HOME=/scratch/.cargo
|
||||||
ENV RUSTFLAGS="-Clinker=clang"
|
ENV RUSTFLAGS="-Clinker=clang"
|
||||||
|
|
||||||
|
@ -73,7 +76,6 @@ RUN if [ "${SCCACHE_REDIS}" != "" ]; then sccache -s; fi
|
||||||
RUN ls -al /usr/src/kanidm/target/release
|
RUN ls -al /usr/src/kanidm/target/release
|
||||||
|
|
||||||
FROM repos
|
FROM repos
|
||||||
LABEL maintainer william@blackhats.net.au
|
|
||||||
|
|
||||||
RUN zypper install -y \
|
RUN zypper install -y \
|
||||||
timezone \
|
timezone \
|
||||||
|
|
Loading…
Reference in a new issue