docker-library / postgres

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

errors trying to install sudo #1136

Closed jjn1056 closed 9 months ago

jjn1056 commented 9 months ago

I had a dockerfile that works fine on 15.3 but breaks on 15.4 with the following error:

0.162 E: Unable to locate package sudo
------
failed to solve: process "/bin/sh -c apt-get install sudo" did not complete successfully: exit code: 100

Here's the dockerfile. If I change "FROM postgres:15.4" to "FROM postgres:15.3" it works fine. Did we remove sudo support?

FROM postgres:15.4

# OS Setup
RUN apt-get update
RUN apt-get install sudo

# Postgresql extension
RUN apt-get install -y postgresql-contrib
RUN apt-get install -y postgis postgresql-15-postgis-3
RUN apt-get install -y postgresql-15-pgvector

# Clean up
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*

# Make postgres user sudoer (maybe don't want this in production)
RUN echo "postgres        ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
RUN sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers

# Add the database initialization script
ADD docker/psql/init.sql /docker-entrypoint-initdb.d
jjn1056 commented 9 months ago

sorry, this was some networking issue with Starlink trying to find Debian mirrors