-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
58 lines (48 loc) · 1.63 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM docker.io/debian:stable-slim AS fetcher
ARG TARGETARCH
ARG FETCH_BINARIES=1
ENV FETCH_BINARIES=$FETCH_BINARIES
COPY build/01-fetch_binaries.sh build/functions.sh /tmp/
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
apt-get update && apt-get install -y curl wget && \
bash -x /tmp/01-fetch_binaries.sh
FROM docker.io/library/alpine:3.21 AS batbelt
ARG PACKAGES="git bash curl wget"
ARG KREWPLUGINS="ns"
ARG INSTALL_SHELL_UTILS=1
ENV PACKAGES=$PACKAGES
ENV KREWPLUGINS=$KREWPLUGINS
ENV INSTALL_SHELL_UTILS=$INSTALL_SHELL_UTILS
ENV HOME=/
ENV KREW_ROOT=/.krew
# Imposta umask per garantire che i file siano leggibili/eseguibili
ENV UMASK=0002
USER root
COPY build/* /tmp/
RUN set -ex \
&& apk update \
&& apk add bash \
&& apk upgrade \
&& apk cache clean
COPY --from=fetcher /tmp/bindir/* /usr/local/bin/
COPY vimrc /.vimrc
COPY motd /etc/motd
COPY entrypoint.sh /entrypoint.sh
COPY zshrc /.zshrc
WORKDIR /
RUN --mount=type=cache,target=/var/cache/apk,sharing=private \
umask ${UMASK} && \
mkdir -p /www/public && chmod -R 777 /www && \
chmod +x /entrypoint.sh && \
/tmp/02-install_packages.sh && \
/tmp/03-install_krew.sh && \
if [ "${SKIP_SHELL_UTILS}" != "true" ]; then /tmp/99-install_shell_utils.sh; fi && \
find ${KREW_ROOT} -type d -exec chmod 755 {} \; && \
find ${KREW_ROOT} -type f -exec chmod 644 {} \; && \
find ${KREW_ROOT}/bin -type f -exec chmod 755 {} \; && \
find ${KREW_ROOT}/store/krew -type f -exec chmod 755 {} \; && \
chown -R 1001:0 ${KREW_ROOT} && \
rm -f /tmp/*.sh
USER 1001
EXPOSE 8080 8081
ENTRYPOINT ["/bin/sh", "-c", "/entrypoint.sh"]