Repository navigation
Expand file tree
/
Copy pathDockerfile.cli
More file actions
71 lines (58 loc) · 1.94 KB
/
Copy pathDockerfile.cli
File metadata and controls
71 lines (58 loc) · 1.94 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
ARG NODE_VERSION=22
FROM node:${NODE_VERSION}-alpine AS node-source
# Node 25+ no longer bundles corepack
RUN [ -d /usr/local/lib/node_modules/corepack ] || npm install -g corepack
FROM docker:cli
ARG NODE_VERSION
# Copy Node.js binaries and libraries from the node-source stage
COPY --from=node-source /usr/local/bin/node /usr/local/bin/node
COPY --from=node-source /usr/local/lib/node_modules/ /usr/local/lib/node_modules/
USER root
# Symlink npm and other tools to make them available in PATH
RUN ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
ln -sf /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
ln -sf /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack && \
chmod +x /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack
# Install required packages
RUN apk add --no-cache \
bash \
curl \
wget \
git \
git-lfs \
jq \
yq \
ca-certificates \
openssl \
gnupg \
which \
zip \
unzip \
xz \
zstd \
coreutils \
findutils \
grep \
sed \
gawk \
sudo \
&& corepack enable
# Install Helm and kubectl
ARG HELM_VERSION=v3.22.0
ARG KUBECTL_VERSION=v1.35.8
RUN set -eux; \
curl -fsSL "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" | tar xz -C /tmp && \
mv /tmp/linux-amd64/helm /usr/local/bin/helm && \
rm -rf /tmp/linux-amd64 && \
curl -fsSLo /usr/local/bin/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
chmod +x /usr/local/bin/helm /usr/local/bin/kubectl && \
helm version && \
kubectl version --client
# Client entrypoint to set DOCKER_HOST sensibly
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV DOCKER_TLS_CERTDIR=/certs
RUN mkdir -p /certs /certs/client && chmod 1777 /certs /certs/client
WORKDIR /workspace
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["sh"]