feat: remove kubectl from base image

This commit is contained in:
ange 2024-05-10 12:01:12 +02:00
parent ad47b53fa0
commit fa2fd22b85
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 2 additions and 14 deletions

View File

@ -1,10 +1,7 @@
name: test
on: push
jobs:
build:
name: test
runs-on: debian
steps:
- uses: actions/checkout@v1

13
debian/Dockerfile vendored
View File

@ -1,13 +1,3 @@
FROM debian:12-slim as kubectl
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
ENV K8S_VERSION=v1.27
RUN V="$(git ls-remote --tags --refs --sort=version:refname https://github.com/kubernetes/kubernetes "$K8S_VERSION.*" | awk -F/ 'END{print $NF}')" \
&& curl -Lo /kubectl "https://dl.k8s.io/release/$V/bin/linux/amd64/kubectl"
FROM debian:12-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
@ -16,4 +6,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
git \
jq \
&& rm -rf /var/lib/apt/lists/*
COPY --from=kubectl --chmod=0755 /kubectl /usr/local/bin/
RUN useradd -m app
USER app