A
A
Artem Kiryanov2021-08-03 21:57:59
Openshift
Artem Kiryanov, 2021-08-03 21:57:59

How to install pgadmin in OpenShift?

In general, I want to install pgadmin in OpenShift, in a specific namespace.
The problem is that I'm not the cluster admin and I can't manage all the policies.

I tried building an image based on pgadmin4 from dockerhub.
Here is my dockerfile

FROM dpage/pgadmin4 as pgadmin4
USER root 
RUN chown 1000640000:1000640000 /pgadmin4 && \
    sed -i 's/5050/1000640000/g' /etc/passwd && \
    sed -i 's/5050/1000640000/g' /etc/group && \
    find / -user 5050 -exec chown 1000640000 {} \; && \
    find / -group 5050 -exec chown :1000640000 {} \; && \
    sed '[email protected] /[email protected] /pgadmin4/[email protected]' /entrypoint.sh

USER 1000640000

VOLUME /var/lib/pgadmin
EXPOSE 8080 8043

ENV [email protected]
ENV PGADMIN_DEFAULT_PASSWORD=admin2021!!


ENTRYPOINT ["/entrypoint.sh"]


But in the pod logs I get an error:
[Errno 1] Operation not permitted: '/var/lib/pgadmin and Failed to create the directory /var/lib/pgadmin/sessions

How to fix this? Am I doing something wrong in my Dockerfile?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kiryanov, 2021-08-04
@hacker342

Since I'm not the cluster administrator and root containers are disabled by default, it's easier to deploy locally.
Theoretically, if you build pgadmin locally in a non-priveleged container, then you can pull it into register and then into shift. But then there will be a clean pgadmin after every container restart because PVs are banned

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question