feat: remove kubectl from base image
This commit is contained in:
parent
ad47b53fa0
commit
fa2fd22b85
@ -1,10 +1,7 @@
|
||||
name: test
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: test
|
||||
runs-on: debian
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
13
debian/Dockerfile
vendored
13
debian/Dockerfile
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user