Skip to content

Question: Why are you installing postgres-client and xdg-utils in the backend docker image? #250

Description

@john0isaac

I'm curious about why you needed to install these two packages for backend postgres-client and xdg-utils? Does it not work on container apps unless they are installed or why?

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends postgresql-client \
&& apt-get update && apt-get install -y xdg-utils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*

Activity

  1. onestardao commented on Aug 20, 2025

    @onestardao

    You’re right to question it — adding postgresql-client and xdg-utils inside a backend image usually means the build is compensating for something upstream.

    • postgresql-client is only needed if you expect to run psql inside the container (migrations, manual queries). The app itself doesn’t need it to talk to Postgres.
    • xdg-utils is a desktop helper (things like xdg-open), and doesn’t belong in a headless backend unless some script is unexpectedly calling it.

    We’ve seen this exact pattern before — image builds that “work” only because they drag in utilities the runtime shouldn’t depend on. In our notes, we classify it as a bootstrap/pre-deploy mis-ordering problem.

    If you’d like, I can share the failure-mode checklist we use (16 common cases with fixes). It might help you see where this fits in. Want me to drop that here?

  2. pamelafox commented on Aug 20, 2025

    @pamelafox
    Contributor

    PSBigBig + MiniPS (@onestardao) Are you a bot? I've seen several of your replies across Azure-samples repos that follow a similar template.

    John Aziz (@john0isaac) I think the postgresql-client might be useful if you're somehow SSH into the container, though I haven't done that. Most likely they are remnants from devcontainer image and can be removed.

    Speaking of bots, we can ask @Copilot to tackle this...

  3. onestardao commented on Aug 20, 2025

    @onestardao

    Human being but use AI and my own Problem map tools to analyse problem , so I can fix more RAG -related bugs more faster

  4. pamelafox commented on Aug 20, 2025

    @pamelafox
    Contributor

    PSBigBig + MiniPS (@onestardao) Got it, okay! Thanks for clarifying.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions