From 36c53aa50e0b4d522293e399191965e6a0d6aa9e Mon Sep 17 00:00:00 2001 From: Mike Wheway Date: Sun, 26 Apr 2026 20:31:51 -0400 Subject: [PATCH 1/3] Add: psql, mariadb, sqlite --- .claude/settings.local.json | 10 +++++++++ .devcontainer/example/devcontainer.json | 2 ++ .env.example | 16 ++++++++----- Dockerfile | 30 ++++++++++++++++++++++++- README.md | 3 +++ 5 files changed, 54 insertions(+), 7 deletions(-) create mode 100755 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100755 index 0000000..a125f77 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,10 @@ +{ + "permissions": { + "allow": [ + "WebFetch(domain:mariadb.com)", + "WebFetch(domain:downloads.mariadb.com)", + "WebFetch(domain:mariadb.org)", + "WebFetch(domain:legacy-downloads.mariadb.com)" + ] + } +} diff --git a/.devcontainer/example/devcontainer.json b/.devcontainer/example/devcontainer.json index f4cedee..bd12aa6 100755 --- a/.devcontainer/example/devcontainer.json +++ b/.devcontainer/example/devcontainer.json @@ -35,6 +35,8 @@ "source=${localEnv:HOME}/.kube,target=/home/vscode/.kube,type=bind,readonly", // SSH keys for Ansible and Git operations "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,readonly", + // Allow writing to known_hosts so you can add new hosts + "source=${localEnv:HOME}/.ssh/known_hosts,target=/home/vscode/.ssh/known_hosts,type=bind", // AWS credentials for the AWS CLI "source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,readonly" ], diff --git a/.env.example b/.env.example index 0636240..34c9d63 100755 --- a/.env.example +++ b/.env.example @@ -14,12 +14,13 @@ # -t devops-toolbox:local . # # VERSION REFERENCE: -# Terraform: https://releases.hashicorp.com/terraform -# kubectl: https://kubernetes.io/releases -# k9s: https://github.com/derailed/k9s/releases -# .NET: https://dotnet.microsoft.com/download/dotnet -# Ansible: https://pypi.org/project/ansible -# Python: https://www.python.org/downloads +# Terraform: https://releases.hashicorp.com/terraform +# kubectl: https://kubernetes.io/releases +# k9s: https://github.com/derailed/k9s/releases +# .NET: https://dotnet.microsoft.com/download/dotnet +# Ansible: https://pypi.org/project/ansible +# Python: https://www.python.org/downloads +# PostgreSQL: https://www.postgresql.org/support/versioning/ # ============================================================================= # Cloud cli tools @@ -42,6 +43,9 @@ STERN_VERSION=v1.33.1 ANSIBLE_VERSION=13.5.0 TERRAFORM_VERSION=1.14.8 +# Database clients +POSTGRESQL_CLIENT_VERSION=18 + # Programming languages DOTNET_VERSION=10.0.201 PYTHON_VERSION=3.12 diff --git a/Dockerfile b/Dockerfile index fbbd0ef..d92a055 100755 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ yq \ # Disk usage analysis ncdu \ + # Database clients + # mariadb-client is installed here rather than via the MariaDB Foundation's + # APT repo (as other tools are) because MariaDB 12.x does not have a stable, + # version-addressable APT repository URL. The Ubuntu LTS package is used instead. + mariadb-client \ + sqlite3 \ # Python (explicit version from deadsnakes PPA for pinning control) python${PYTHON_VERSION} \ python${PYTHON_VERSION}-venv \ @@ -66,13 +72,35 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pipx \ # Shell completion framework (required for kubectl/terraform completions) bash-completion \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* # Ensure pipx binaries are on PATH for all subsequent RUN steps and terminals ENV PATH="/root/.local/bin:/home/vscode/.local/bin:${PATH}" ENV PIPX_HOME="/usr/local/pipx" ENV PIPX_BIN_DIR="/usr/local/bin" +# ----------------------------------------------------------------------------- +# PostgreSQL Client +# Installed via the PostgreSQL Global Development Group (PGDG) APT repository +# for exact major-version pinning and access to current point releases. +# Provides: psql, pg_dump, pg_restore, pg_dumpall. +# Shell completions are shipped with the package and auto-loaded by +# bash-completion — no explicit step required. +# ----------------------------------------------------------------------------- +ARG POSTGRESQL_CLIENT_VERSION=18 + +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | gpg --dearmor \ + | tee /etc/apt/keyrings/postgresql.gpg > /dev/null \ + && echo "deb [arch=${TARGETARCH} signed-by=/etc/apt/keyrings/postgresql.gpg] \ + https://apt.postgresql.org/pub/repos/apt \ + $(lsb_release -cs)-pgdg main" \ + | tee /etc/apt/sources.list.d/postgresql.list \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + postgresql-client-${POSTGRESQL_CLIENT_VERSION} \ + && rm -rf /var/lib/apt/lists/* \ + && psql --version # ----------------------------------------------------------------------------- # .NET SDK diff --git a/README.md b/README.md index 435c401..e5bebc1 100755 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ with Docker and VS Code — no local setup required. | [gcloud CLI](https://cloud.google.com/sdk/gcloud) | See [Dockerfile](./Dockerfile) | Google Cloud resource management | | [GitHub CLI](https://cli.github.com) | See [Dockerfile](./Dockerfile) | GitHub workflow management | | [AWS CLI](https://aws.amazon.com/cli/) | See [Dockerfile](./Dockerfile) | AWS resource management | +| [psql](https://www.postgresql.org/docs/current/app-psql.html) | See [Dockerfile](./Dockerfile) | PostgreSQL CLI client | +| [mariadb / mysql](https://mariadb.org) | See [Dockerfile](./Dockerfile) | MariaDB and MySQL CLI client | +| [sqlite3](https://sqlite.org) | See [Dockerfile](./Dockerfile) | SQLite CLI client | | [ipython](https://ipython.org) | See [dependencies/](./dependencies/) | Enhanced Python REPL | | [pytest](https://pytest.org) | See [dependencies/](./dependencies/) | Python testing | | [black](https://black.readthedocs.io) | See [dependencies/](./dependencies/) | Python code formatting | From 00d344c0a29b0b1fe2a5201ecfd83248724b24cc Mon Sep 17 00:00:00 2001 From: Mike Wheway <22455168+Taegost@users.noreply.github.com> Date: Sun, 26 Apr 2026 20:44:24 -0400 Subject: [PATCH 2/3] Update: Postgres install to give better indication on failure Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d92a055..9377f0d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -90,12 +90,12 @@ ENV PIPX_BIN_DIR="/usr/local/bin" ARG POSTGRESQL_CLIENT_VERSION=18 RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | gpg --dearmor \ - | tee /etc/apt/keyrings/postgresql.gpg > /dev/null \ - && echo "deb [arch=${TARGETARCH} signed-by=/etc/apt/keyrings/postgresql.gpg] \ - https://apt.postgresql.org/pub/repos/apt \ - $(lsb_release -cs)-pgdg main" \ - | tee /etc/apt/sources.list.d/postgresql.list \ + -o /tmp/postgresql.asc \ + && mkdir -p /etc/apt/keyrings \ + && gpg --dearmor -o /etc/apt/keyrings/postgresql.gpg /tmp/postgresql.asc \ + && rm /tmp/postgresql.asc \ + && echo "deb [arch=${TARGETARCH} signed-by=/etc/apt/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \ + > /etc/apt/sources.list.d/postgresql.list \ && apt-get update \ && apt-get install -y --no-install-recommends \ postgresql-client-${POSTGRESQL_CLIENT_VERSION} \ From 3824d8f77f8ca8c33e5bff478c0ee8fc117fbb12 Mon Sep 17 00:00:00 2001 From: Mike Wheway <22455168+Taegost@users.noreply.github.com> Date: Mon, 27 Apr 2026 09:24:43 -0400 Subject: [PATCH 3/3] Remove Postgres key and repo after install Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 9377f0d..d517488 100755 --- a/Dockerfile +++ b/Dockerfile @@ -99,6 +99,7 @@ RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ && apt-get update \ && apt-get install -y --no-install-recommends \ postgresql-client-${POSTGRESQL_CLIENT_VERSION} \ + && rm -f /etc/apt/sources.list.d/postgresql.list /etc/apt/keyrings/postgresql.gpg \ && rm -rf /var/lib/apt/lists/* \ && psql --version