jenkins
This commit is contained in:
+7
-10
@@ -1,11 +1,7 @@
|
||||
FROM golang:1.25 AS builder
|
||||
FROM docker.m.daocloud.io/debian:stable-slim
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
|
||||
RUN GOPROXY=https://goproxy.cn make build
|
||||
|
||||
FROM debian:stable-slim
|
||||
# BIN_NAME 必须与 Makefile build 的 -o 产物名一致(Jenkins 会传 --build-arg)
|
||||
ARG BIN_NAME=kratos-admin
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
@@ -13,9 +9,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/ \
|
||||
&& apt-get autoremove -y && apt-get autoclean -y
|
||||
|
||||
RUN groupadd --system kra && useradd --system --gid kra --home-dir /app kra
|
||||
# Fixed UID/GID so the init container can chown the hostPath config dir.
|
||||
RUN groupadd --system --gid 1000 kra && useradd --system --uid 1000 --gid kra --home-dir /app kra
|
||||
|
||||
COPY --from=builder --chown=kra:kra /src/bin /app
|
||||
COPY --chown=kra:kra bin /app
|
||||
|
||||
RUN mkdir -p /data/conf /app/uploads/file && chown -R kra:kra /data/conf /app/uploads
|
||||
|
||||
@@ -27,4 +24,4 @@ EXPOSE 8000
|
||||
EXPOSE 9000
|
||||
VOLUME /data/conf
|
||||
|
||||
CMD ["./kratos-admin", "-conf", "/data/conf"]
|
||||
CMD ["./${BIN_NAME}", "-conf", "/data/conf"]
|
||||
Reference in New Issue
Block a user