Switch to bluefin for test server

Hi everybody.
In my job we use a tomcat webapp, with postgresql.
So we put out webapp under /opt/tomcat and so on.

Everytime Tomcat versione change or we need to use different tomcat version, we take a new port.
Same for postgresql.

Or I need to have multiple version of tomcat and Postgresql to test.

I would like to use bluefin atomic distro, but I’m confused how.

We need to install tomcat and postgresql, maybe in different version, what Is Better? Docker, podman , toolbox , distrobox?

Sorry, I think atomic distro Is a big idea but I need to use It as a webapp server.

Many thanks!

If you want to use container technology there is nothing special about Blufin. Just like on any other Linux distro.

By default on Blufin are installed: podman, toolbox and distrobox.
Docker is not installed by default.

Podman and Docker are lets say on the same level. They are container technology.

Toolbox and Distrobox are higher abstraction level for Docker or Podman. There are no big differences between this two tools, just they are written in different programming languages.

I don’t think you need toolbox or distrobox. They are primary intended so container can easily access files on your host Linux. For example you install text editor in container, start text editor program from container and now you would like to edit files on host (e.g. on Blufin). This is easily done with toolbox/distrobox, because this is default behaviour. It can be done from lower level podman or docker, but little bit more knowledge is required.

You can use Blufin for server related software, for testing environment is probably good enough. But running it in production it is probably better to use server products like uCore if you want from Universal Blue.

I have played little bit (I am not an expert in podman!!!), bellow just a taste, you will probably need to investigate more for youself or ask for additional help. Maybe this is not the best forum - search for specific podman forum for detailed help.

Try something like:

# create pod
podman pod create --name mypod_01 --publish 5001:5432/TCP --publish 8001:8080/TCP

# create directory on Blufin host
mkdir $HOME/data_postgres_01

# create container for postgres
podman run -d                       \
  --name postgres_01                \
  --pod mypod_01                    \
  -e POSTGRES_PASSWORD=mypassword   \
  -e POSTGRES_DB=mydb               \
  -v pgdata:/$HOME/data_postgres_01 \
  docker.io/library/postgres:latest

# create directory for tomcat
mkdir $HOME/data_tomcat_01

# create container for tomcat
podman run -d                       \
  --name tomcat_01                  \
  --pod mypod_01                    \
  -v tomcat:/$HOME/data_tomcat_01   \
  docker.io/library/tomcat:latest

# TEST

# From Blufin host install postgres client
brew doctor
brew update
brew install libpq
brew link --force libpq
PGPASSWORD=mypassword psql -h localhost -d mydb -p 5001 -U postgres
# You should get: "mydb=#" prompt that indicates you have successfully connected. Type: "exit" to exit prompt.

# Enter inside tomcat container install postgres client and test connection
podman exec -ti tomcat_01 bash
apt update
apt install -y postgresql-client
PGPASSWORD=mypassword psql -h localhost -d mydb -p 5432 -U postgres
# You should get: "mydb=#" prompt that indicates you have successfully connected. Type: "exit" to exit prompt.

# list containers and delete them
podman ps --all
podman rm --force postgres_01 tomcat_01  

# list pods and delete it
podman pod ps  
podman pod rm mypod_01