Try multi stage building
This commit is contained in:
parent
fa0749ae81
commit
44a3d31301
24
Dockerfile
24
Dockerfile
@ -1,12 +1,24 @@
|
|||||||
FROM alpine:3.19
|
# שלב 1: בניית כלים
|
||||||
|
FROM alpine:3.19 as builder
|
||||||
|
|
||||||
# התקנת כלים שאתה צריך
|
|
||||||
RUN apk add --no-cache bash git yq curl
|
RUN apk add --no-cache bash git yq curl
|
||||||
|
|
||||||
# הורדת Kaniko למיקום יציב
|
# הורדת Kaniko בינארי
|
||||||
RUN curl -sSL -o /usr/local/bin/kaniko \
|
RUN curl -sSL -o /kaniko \
|
||||||
https://github.com/GoogleContainerTools/kaniko/releases/download/v1.21.0/executor && \
|
https://github.com/GoogleContainerTools/kaniko/releases/download/v1.20.1/executor && \
|
||||||
chmod +x /usr/local/bin/kaniko
|
chmod +x /kaniko
|
||||||
|
|
||||||
|
# שלב 2: בניית פלאגין סופי על בסיס woodpeckerci/plugin-kaniko
|
||||||
|
FROM woodpeckerci/plugin-kaniko:latest
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# העתקת הכלים מה-builder
|
||||||
|
COPY --from=builder /kaniko /usr/local/bin/kaniko
|
||||||
|
COPY --from=builder /bin/bash /bin/bash
|
||||||
|
COPY --from=builder /usr/bin/git /usr/bin/git
|
||||||
|
COPY --from=builder /usr/bin/yq /usr/bin/yq
|
||||||
|
COPY --from=builder /usr/bin/curl /usr/bin/curl
|
||||||
|
|
||||||
ENV PATH="/usr/local/bin:$PATH"
|
ENV PATH="/usr/local/bin:$PATH"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user