kra-new/Dockerfile

29 lines
799 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM docker.m.daocloud.io/debian:stable-slim
# BIN_NAME 必须与 Makefile build 的 -o 产物名一致Jenkins 会传 --build-arg
ARG BIN_NAME=kratos-admin
ENV BIN_NAME=${BIN_NAME}
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
&& rm -rf /var/lib/apt/lists/ \
&& apt-get autoremove -y && apt-get autoclean -y
# Fixed UID/GID so the init container can prepare shared storage.
RUN groupadd --system --gid 1000 kra && useradd --system --uid 1000 --gid kra --home-dir /app kra
COPY --chown=kra:kra bin /app
RUN mkdir -p /data/conf /app/uploads/file && chown -R kra:kra /data/conf /app/uploads
WORKDIR /app
USER kra
EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf
CMD ["sh", "-c", "exec ./$BIN_NAME -conf /data/conf"]