How to build postgis container as root user using docker-compose up
?
In Dockerfile, separate attempts to set USER
to root
as well 0
did not work.
Updating docker-compose service with user: '0'
was tried to no avail.
There error I am getting is Permission denied
.
The id -u
is always running as 999
during the build. This seems to be a system user with limited privilege.
I would prefer to just run docker-compose up
with no flags and keep all configurations in docker-compose.yml
and/or Dockerfile
.
Dockerfile
FROM postgis/postgis:13-3.3
USER root
COPY ./startup.sh /docker-entrypoint-initdb.d/startup.sh
NOTE:
I realized that I should have added more context. I created another post that better describes the issue.
Please be carefull with root, it can inject vulnerabilities in your database. I highly recommend to you to use it only for development.
You can run this command below:
Or put it in your docker-compose file: