docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

Problem to extend postgres:15.1-bullseye image #1031

Closed benjaminpochat closed 1 year ago

benjaminpochat commented 1 year ago

Hello,

I try to extend postgres:15.1-bullseye to install the package postgresql-15-wal2json. But I not able to run any basic shell command in a dockerfile starting from postgres:15.1-bullseye. For instance with the dockerfile below :

FROM postgres:15.1-bullseye

RUN echo 'hello world !'

I got this error :

$ docker build .
Sending build context to Docker daemon  7.168kB
Step 1/2 : FROM postgres:15.1-bullseye
 ---> 68f5d950dcd3
Step 2/2 : RUN echo 'hello world !'
 ---> Running in 031a07b21a37
**OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown**

The error does not occur if I switch the first line to one of those :

FROM postgres:15.1-alpine

or

FROM postgres:14.6-bullseye

Is that behaviour something expected ? How to build an image starting from postgres:15.1-bullseye ?

Note : I use docker desktop for Windows

tianon commented 1 year ago

My guess is a corrupted or incomplete local image -- I'd suggest checking the storage in your Docker Desktop VM, pruning some images (including the one that isn't working), re-pulling, and trying again.

In the future, these sorts of questions/requests would be more appropriately posted to a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.

benjaminpochat commented 1 year ago

It works after pruning the image. Thanks for your reply. Understood for using the forums instead.