Skip to content

Instantly share code, notes, and snippets.

@bpmct
Last active August 17, 2023 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpmct/05cfb671d1d468ae3be46e93173a02ea to your computer and use it in GitHub Desktop.
Save bpmct/05cfb671d1d468ae3be46e93173a02ea to your computer and use it in GitHub Desktop.

Coder added jq to the base image to support mounting secrets from AWS Secrets Manager, or other Kubernetes secrets that are in JSON format. Example:

# Helm values.yaml
coder:
  command:
    - /bin/sh
    - -c     - CODER_PG_CONNECTION_URL=postgresql://coder:$(cat /mnt/postgres-pass/secret.json | jq -r .password)@coder-db.coder.svc.cluster.local:5432/coder /opt/coder server
  volumes:
  - name: "postgres-pass"
    secret:
      secretName: "coder-db-pass"
  volumeMounts:
  - name: "postgres-pass"
    mountPath: "/mnt/postgres-pass"

As of Coder v2.1.0, we removed jq from the base image. To build your own images with this support, you can extend our image:

# Dockerfile
FROM ghcr.io/coder/coder:v2.1.0

USER root

RUN apk add --no-cache jq

USER coder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment