docker-library / docker-library/postgres

Container in Ubuntu aarch64 machine cannot use Docker Secrets feature

Open
#1,339 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
2.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I once built a postgres container in an Ubuntu x86_64 machine, and everything's fine. Yet when I tried to build the container with the same commands in an Ubuntu aarch64 machine, it failed.

The commands are:

docker volume create pgdata
docker create --name=mydb -e POSTGRES_DB=wiki -e POSTGRES_USER=wiki -e POSTGRES_PASSWORD_FILE=/etc/wiki/.db-secret -v /etc/wiki/.db-secret:/etc/wiki/.db-secret:ro -v pgdata:/var/lib/postgresql/data --restart=unless-stopped -h db --network=wikinet postgres:17
docker start mydb

Using docker ps command to check the container status, will show the following :

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bad868f86f56 postgres:17 "docker-entrypoint.s…" 30 seconds ago Restarting (1) Less than a second ago mydb

Then debug using docker logs mydb command, it shows :

Error: Database is uninitialized and superuser password is not specified.
You must specify POSTGRES_PASSWORD to a non-empty value for the
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

   You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
   connections without a password. This is *not* recommended.

   See PostgreSQL documentation about "trust":
   https://www.postgresql.org/docs/current/auth-trust.html

Then I modify the commands, using POSTGRES_PASSWORD instead of POSTGRES_PASSWORD_FILE, and it works.
I checked postgres:17, postgres:16, postgres:15, and they had the same error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented docker volume, create, and start commands on Ubuntu aarch64 and x86_64, then compare the docker logs output across postgres:15, postgres:16, and postgres:17. Trace how POSTGRES_PASSWORD_FILE and the mounted secret are handled during initialization; done means identifying the architecture-specific cause and restoring or documenting working Docker Secrets behavior with a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, postgres, shell, ubuntu
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.