Root access to the PostGreSQL 9.5 CentOS 7 container

In the past, I have always built servers from the ground up.

But, I am now trying to work with Docker containers.

I can not seem to be able to build a new Docker CentOS 7 Server image, with PostGreSQL.

As such, after much frustration, I decided to use a pre-built CentOS 7 server with PostGreSQL already installed.

But, I need to install quite a bit of software on this same server.

I can not switch to root inside of this new container.

Questions:

  1. How do I get to the root prompt in this new container?

  2. With SystemD not available inside of the CentOS 7 container, is there a way… Are there any instructions that would tell me how to install and configure PostGreSQL in a CentOS 7 / RedHat 7 container?

  3. Finally, has anyone created a CentOS 7 container, with both PostGreSQL and LVM (Logical Volume Manager)?

Note that I always build my servers with LVM, and I need root access to every container, regardless of what is running in that container.

Will LVM work inside of Docker?

WIll LVM work inside of a CentOS 7 container?

What I really need, is the ability to build a Docker container, with CentOS 7, LVM and PostGreSQL.

Does such a container already exist?

If not, how can I build a CentOS 7 container, with LVM?

If not, how can I build a CentOS 7 container, with PostGreSQL (from scratch)?

Note: I already know how to build a CentOS 7 container with PostGreSQL installed, but whenever I attempt to start the database, I get systemd related errors.

If not, how can I build a CentOS 7 container, with both LVM and PostGreSQL?

If not, how can I get around the systemd errors?

I found the answer I was looking for in a MySQL / MariaDB forum.

This post can be closed.