Skip to content

Commit 223ef44

Browse files
use debian bullseye-slim (#60)
* use debian bullseye-slim * Use chmod arguments instead of commands https://docs.google.com/document/d/1Ydhdgm2-eu30xV003wlvxQWnC2wuvX3xdPcXNVBuyvg * suggest optimiztions * add gecos Co-authored-by: Ilia Medvedev <[email protected]>
1 parent c5a9f23 commit 223ef44

File tree

3 files changed

+11
-40
lines changed

3 files changed

+11
-40
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

Dockerfile

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM alpine:3.6 AS builder
33
RUN apk update && apk add curl
44

55
RUN export ARCH=$([[ "$(uname -m)" == "aarch64" ]] && echo "arm64" || echo "amd64") && \
6+
mkdir -p /tmp/kubectl-versions && cd /tmp/kubectl-versions \
67
curl -o kubectl1.22 -L https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/linux/${ARCH}/kubectl && \
78
curl -o kubectl1.21 -L https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/${ARCH}/kubectl && \
89
curl -o kubectl1.20 -L https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/${ARCH}/kubectl && \
@@ -19,49 +20,18 @@ RUN export ARCH=$([[ "$(uname -m)" == "aarch64" ]] && echo "arm64" || echo "amd6
1920
curl -o kubectl1.6 -L https://storage.googleapis.com/kubernetes-release/release/v1.6.0/bin/linux/${ARCH}/kubectl
2021

2122

22-
FROM alpine:3.15.6
23+
FROM debian:bullseye-slim
2324

24-
RUN apk --no-cache update && apk upgrade && apk add --update bash
25+
RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu
2526

26-
#copy all versions of kubectl to switch between them later.
27-
COPY --from=builder kubectl1.22 /usr/local/bin/
28-
COPY --from=builder kubectl1.21 /usr/local/bin/
29-
COPY --from=builder kubectl1.20 /usr/local/bin/
30-
COPY --from=builder kubectl1.19 /usr/local/bin/
31-
COPY --from=builder kubectl1.18 /usr/local/bin/
32-
COPY --from=builder kubectl1.17 /usr/local/bin/
33-
COPY --from=builder kubectl1.16 /usr/local/bin/
34-
COPY --from=builder kubectl1.15 /usr/local/bin/
35-
COPY --from=builder kubectl1.14 /usr/local/bin/
36-
COPY --from=builder kubectl1.13 /usr/local/bin/
37-
COPY --from=builder kubectl1.12 /usr/local/bin/
38-
COPY --from=builder kubectl1.11 /usr/local/bin/
39-
COPY --from=builder kubectl1.10 /usr/local/bin/kubectl
40-
COPY --from=builder kubectl1.6 /usr/local/bin/
27+
#RUN apt update && apt upgrade && apt install bash # THIS IS NOT REQUIRED. BASH IS ALREADY INCLUDED IN BULLSEYE
4128

42-
RUN chmod +x /usr/local/bin/kubectl \
43-
/usr/local/bin/kubectl1.6 \
44-
/usr/local/bin/kubectl1.11 \
45-
/usr/local/bin/kubectl1.12 \
46-
/usr/local/bin/kubectl1.13 \
47-
/usr/local/bin/kubectl1.14 \
48-
/usr/local/bin/kubectl1.15 \
49-
/usr/local/bin/kubectl1.16 \
50-
/usr/local/bin/kubectl1.17 \
51-
/usr/local/bin/kubectl1.18 \
52-
/usr/local/bin/kubectl1.19 \
53-
/usr/local/bin/kubectl1.20 \
54-
/usr/local/bin/kubectl1.21 \
55-
/usr/local/bin/kubectl1.22
29+
#copy all versions of kubectl to switch between them later.
30+
COPY --chown=cfu --chmod=775 --from=builder /tmp/kubectl-versions/* /usr/local/bin/
31+
RUN cp /usr/local/bin/kubectl1.10 /usr/local/bin/kubectl
5632

5733
WORKDIR /
58-
59-
ADD cf-deploy-kubernetes.sh /cf-deploy-kubernetes
60-
ADD template.sh /template.sh
61-
62-
RUN adduser -D -h /home/cfu -s /bin/bash cfu \
63-
&& chgrp -R $(id -g cfu) /cf-deploy-kubernetes /usr/local/bin /template.sh \
64-
&& chmod -R g+rwX /cf-deploy-kubernetes /usr/local/bin /template.sh
34+
ADD --chown=cfu --chmod=775 cf-deploy-kubernetes.sh /cf-deploy-kubernetes
35+
ADD --chown=cfu --chmod=775 template.sh /template.sh
6536
USER cfu
66-
6737
CMD ["bash"]

service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 16.1.11
1+
version: 16.2.0

0 commit comments

Comments
 (0)