Skip to content

chore(ci): Add dockerfmt CI check #17120

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

chore(ci): Add dockerfmt CI check #17120

wants to merge 4 commits into from

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Apr 11, 2025

What this PR does / why we need it:

Unifies formatting of Dockerfiles

https://github.com/reteps/dockerfmt

Copy link
Contributor

Helm Diff Output - Summary

Default Values Scenario-diff-output
Distributed Scenario-diff-output
Ingress Values Scenario-diff-output
default, loki-release-gateway, Deployment (apps) has changed:
  # Source: loki/templates/gateway/deployment-gateway-nginx.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: loki-release-gateway
    namespace: default
    labels:
      helm.sh/chart: loki-6.29.0
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.4.2"
      app.kubernetes.io/component: gateway
  spec:
    replicas: 1
    strategy:
      type: RollingUpdate
    revisionHistoryLimit: 10
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: gateway
    template:
      metadata:
        annotations:
          checksum/config: 440a9cd2e87de46e0aad42617818d58f1e2daacb1ae594bad1663931faa44ebc
-         prometheus.io/port: "3100"
-         prometheus.io/scrape: "true"
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: gateway
      spec:
        serviceAccountName: loki
        enableServiceLinks: true
        
        securityContext:
          fsGroup: 101
          runAsGroup: 101
          runAsNonRoot: true
          runAsUser: 101
        terminationGracePeriodSeconds: 30
        containers:
          - name: nginx
            image: docker.io/nginxinc/nginx-unprivileged:1.27-alpine
            imagePullPolicy: IfNotPresent
            ports:
              - name: http-metrics
                containerPort: 8080
                protocol: TCP
            readinessProbe:
              httpGet:
                path: /
                port: http-metrics
              initialDelaySeconds: 15
              timeoutSeconds: 1
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            volumeMounts:
              - name: config
                mountPath: /etc/nginx
              - name: tmp
                mountPath: /tmp
              - name: docker-entrypoint-d-override
                mountPath: /docker-entrypoint.d
            resources:
              {}
        affinity:
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/component: gateway
              topologyKey: kubernetes.io/hostname
        volumes:
          - name: config
            configMap:
              name: loki-release-gateway
          - name: tmp
            emptyDir: {}
          - name: docker-entrypoint-d-override
            emptyDir: {}
Legacy Monitoring Values Scenario-diff-output
default, loki-release-gateway, Deployment (apps) has changed:
  # Source: loki/templates/gateway/deployment-gateway-nginx.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: loki-release-gateway
    namespace: default
    labels:
      helm.sh/chart: loki-6.29.0
      app.kubernetes.io/name: loki
      app.kubernetes.io/instance: loki-release
      app.kubernetes.io/version: "3.4.2"
      app.kubernetes.io/component: gateway
  spec:
    replicas: 1
    strategy:
      type: RollingUpdate
    revisionHistoryLimit: 10
    selector:
      matchLabels:
        app.kubernetes.io/name: loki
        app.kubernetes.io/instance: loki-release
        app.kubernetes.io/component: gateway
    template:
      metadata:
        annotations:
          checksum/config: 440a9cd2e87de46e0aad42617818d58f1e2daacb1ae594bad1663931faa44ebc
-         prometheus.io/port: "3100"
-         prometheus.io/scrape: "true"
        labels:
          app.kubernetes.io/name: loki
          app.kubernetes.io/instance: loki-release
          app.kubernetes.io/component: gateway
      spec:
        serviceAccountName: loki
        enableServiceLinks: true
        
        securityContext:
          fsGroup: 101
          runAsGroup: 101
          runAsNonRoot: true
          runAsUser: 101
        terminationGracePeriodSeconds: 30
        containers:
          - name: nginx
            image: docker.io/nginxinc/nginx-unprivileged:1.27-alpine
            imagePullPolicy: IfNotPresent
            ports:
              - name: http-metrics
                containerPort: 8080
                protocol: TCP
            readinessProbe:
              httpGet:
                path: /
                port: http-metrics
              initialDelaySeconds: 15
              timeoutSeconds: 1
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                - ALL
              readOnlyRootFilesystem: true
            volumeMounts:
              - name: config
                mountPath: /etc/nginx
              - name: tmp
                mountPath: /tmp
              - name: docker-entrypoint-d-override
                mountPath: /docker-entrypoint.d
            resources:
              {}
        affinity:
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchLabels:
                  app.kubernetes.io/component: gateway
              topologyKey: kubernetes.io/hostname
        volumes:
          - name: config
            configMap:
              name: loki-release-gateway
          - name: tmp
            emptyDir: {}
          - name: docker-entrypoint-d-override
            emptyDir: {}
Simple Scalable AWS Kube IRSA Values Scenario-diff-output
Simple Thanos Values Scenario-diff-output

Signed-off-by: Christian Haudum <[email protected]>
@chaudum chaudum force-pushed the chaudum/dockerfmt branch from 5acb8cc to 0703184 Compare April 11, 2025 07:01
@@ -26,4 +26,4 @@ COPY --from=temp /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /src/loki/clients/cmd/docker-driver/docker-driver /bin/docker-driver

WORKDIR /bin/
ENTRYPOINT [ "/bin/docker-driver" ]
ENTRYPOINT ["/bin/docker-driver"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at the end of file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant