Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add kube-linter binary #209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Define the google cloud sdk image tag to use.
ARG GOOGLE_CLOUD_CLI_IMAGE_TAG=490.0.0-alpine

# Build go binaries
FROM golang:1.23.0-alpine3.20 AS gobinaries

# https://github.com/stackrox/kube-linter
ENV KUBELINTER_VERSION=0.6.8
RUN apk --no-cache add git \
&& go install golang.stackrox.io/kube-linter/cmd/kube-linter@v${KUBELINTER_VERSION}

FROM eu.gcr.io/google.com/cloudsdktool/google-cloud-cli:${GOOGLE_CLOUD_CLI_IMAGE_TAG}

# https://github.com/docker/compose/releases
Expand All @@ -15,7 +23,7 @@
ENV STERN_RELEASE_VERSION=1.28.0

# Use the gke-auth-plugin to authenticate to the GKE cluster.
ENV USE_GKE_GCLOUD_AUTH_PLUGIN=true

Check warning on line 26 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "USE_GKE_GCLOUD_AUTH_PLUGIN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

RUN apk add --no-cache py-pip python3-dev curl make gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux && \
# Install docker and docker-compose.
Expand Down Expand Up @@ -64,6 +72,10 @@

RUN echo "source /google-cloud-sdk/path.bash.inc" >> /etc/profile

# Install kube-linter copying the binary from the gobinaries stage
COPY --from=gobinaries /go/bin/kube-linter /usr/local/bin/kube-linter
RUN chmod +x /usr/local/bin/kube-linter

COPY configs /configs

COPY docker-entrypoint.sh /usr/local/bin/
Expand Down