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

Hi Paul, I haven’t reached that part yet, but since I’ll stomp on this in the future and I have docker fresh I’m giving it a shot.
First of all, I’m assuming that in the tutorial they are using Natural installed on windows and therefor there is not much complication to read files.
Now, using natural-ce in docker, we need to allow the container to read data from an external folder… in the past I’ve used “volumes” to allow that behavior.
Let’s see if that works.
Before that, I’m going to try to run the program without changing anything to try to replicate your problem.
I’ll download the cruise.csv into a new folder in C:\my-files and edit the program accordingly, build the project, upload it and run it…

Ok, that was expected. Then, how do I tell docker where my files are? There are a few mechanism in docker but I think Volumes might be the right choice.
I’ll try to achieve it with docker compose first as I think is the easiest, but maybe I’ll try later to do it running a single container.
Please note, and this might be important, there may be differences if you don’t use WSL (Windows Subsystem for Linux) and Docker Desktop.
I use WSL, I think is an amazing development experience but it has some caveats, mainly configuration and wrapping your head around being a virtual machine as it not feels like one. In any case, I’ll try to make it work on my machine first.

So, what I’m going to do is to add a Volume tag to the compose file and reference the path on my machine and the path where I want those files in the filesystem of the container.

Ok, easy enough, I had to delete the containers and recreate them, but it seems to work.

Now, the question is, will Natural be able to load that file?
Since I’ve deleted the containers I have to rebuild and upload the project again.

I’ve check the hello world and both HELLO-P and GET-Em programs are working… :melting_face: I had to rebuild a couple times but seems like is working. Anyway, now to check the WORKFPGN program and try to make it work.

The file referenced in the program

DEFINE WORK FILE 1 'C:\my-files\CRUISE.CSV'     TYPE 'CSV'

doesn’t makes sense in the container, but, as shown previously, is in /home folder, so let’s try that. just change that line.

DEFINE WORK FILE 1 '/home/CRUISE.CSV'     TYPE 'CSV'

build, upload and… it’s working!!!

Now let’s check if I can make changes to the CSV on windows and see those reflected in natural output.

I open the csv on my editor and change the first line

Rerun the program in natural…


and it works as well.

So… what’s the deal?

Docker Is really sophisticated but not intuitive. A lot of his magic happens in the shadows and sometimes is hard to grasp. This solution may be half baked and probably doesn’t follow best practice, but it works and most probably, if you work in a company somebody with better understanding than me will be the responsible of setting up your dev enviroment.

Also, this solution rely on Docker Desktop and WSL2, which if you think about it is frankly scary (My system is windows, but it has a virtual machine that runs linux (wsl), and then docker run some containers on that virtual machine, to virtualize 3 unix instances which needs to access the files on the original windows system :exploding_head: ) So much complexity totally abstracted to us.

Now, I hope you understand you have to change the paths to suit your filesystem. Also, if you are not using docker-compose (you probably don’t as the guide don’t mention it at all) you can create those volumes with the -v flag such us

docker run -d -p 2700:2700 -v /c/my-files:/home --add-host adabas-db:<YOUR-IP> -e ACCEPT_EULA=Y --name natural-ce softwareag/natural-ce:9.2.1

haven’t tried that yet, so luck with that.

Also, if you are not using WSL, you may need to reference your local path as you do normally on windows.

docker run -d -p 2700:2700 -v C:\my-files:/Home --add-host adabas-db:<YOUR-IP> -e ACCEPT_EULA=Y --name natural-ce softwareag/natural-ce:9.2.1

I haven’t tried that one either. In fact I’m really scared of changing many configurations in my system since Natural+Adabas is quite the pain to make it work.

Anyway, let me know if you make it work.