My journey to install NaturalOne CE on Win11 with Docker Desktop in 2023

Learning about docker networking

I’m reading this guide
My goal is to create a network connection between the natural-CE container and the adabas-ce container whitout having to set it up manually.
Right now we do it telling the natural container to add an extra-host when running the container which literally add 192.168.1.36 adabas-db to the /etc/hosts/ in the container during initialization. That means, that if we put adabas-db in a browser inside that container we would be able to access the database…, right?


actually it does (forget the 0.0.0.0 adabas-db, is the config I used during this container run (which doesn’t work), it should be the IP I got earlier)
So, how do I fix it. Let’s go back to the guide.

Apparently docker creates a bridge when it creates container, and every container can see each other, but you need the ip. In adabas manager I can tell him which IP to use because they are already running and I can check for that, but how can I do it programaticly?
The guide mentions a user-defined bridge. Let’s check the docs

Alright, so we can create a new network
docker network create my-docker-net
and use that network when creating the containers.

docker run -d -p 60001:60001 -p 8190:8190 -e ACCEPT_EULA=Y -e ADADBID=12 -e "ADA_DB_CREATION=demodb" --name adabas-db --network my-docker-net softwareag/adabas-ce:7.1.1

Or connect a running container to that network, I’ll try adabas-manager to test the functionality. To do that I have to add both adabas-db and adabas-manager to the same network
docker network connect my-docker-net adabas-db
and
docker network connect my-docker-net adabas-manager

Now in theory I should be able to connect adabas manager to adabas using the name of the container as the hostname


It worked!!

Alright… let’s think the next step. I should be able to remove the extra host from the natural-ce container and connect it to the same network, right?
Let’s see how to do that in the docker compose to make it easier.
Mmm, the docs are interesting… when you use compose it creates a network by default called the same as the folder where the docker-compose.yaml file is located. Does that mean that I don’t have to add the extra-host in it? Well, that’s should be right if the container name is the same as the host we are adding which is true in this case. Let me check it.
My theory is… Eclipse connects to natural-ce container through localhost, and natural should be configured to connect to adabas-db using that as a host…

Natural is working…

and adabas is working too!!!

You don’t need to set the extra-host in docker compose!! So nice!
But, if you are running the container by themselves you have to create a network and set the network for each container.
But if you use Docker compose (which looks better and better every time) you can omit a lot and just use the container names as host for connectivity.
Here is my docker-compose.yaml now

docker-compose.yaml

version: ‘3.3’
services:
adabas-ce:
ports:
- ‘60001:60001’
- ‘8190:8190’
environment:
- ACCEPT_EULA=Y
- ADADBID=12
- ADA_DB_CREATION=demodb
container_name: adabas-db
image: ‘softwareag/adabas-ce:7.1.1’
natural-ce:
ports:
- ‘2700:2700’
environment:
- ACCEPT_EULA=Y
container_name: natural-ce
image: ‘softwareag/natural-ce:9.2.1’
adabasmanager-ce:
ports:
- ‘4990:4990’
environment:
- ACCEPT_EULA=Y
container_name: adabas-manager
image: ‘softwareag/adabasmanager-ce:9.1.0.1’

Also, for those interested, you can check the configuration of natural in

You can see it is preconfigured to map db 12, which is the one loaded with examples and 11, which doesn’t exist at this moment, to the host ADABAS-DB:60001.

I have to keep this in mind for when I create my own database for learning. How can I edit files in UNIX when I don’t have vi installed? Maybe through sh? In any case, case closed for now. Hope it helped somebody. Sorry for being so chaotic, as I said I’m documenting while I’m learning.