Docker-Compose with Balena on PLCNext

Hey everyone,
I’ve been having a bit of an issue getting Docker-Compose and Balena Engine to play nice on the AXCF 2152 with the latest firmware. I’ve installed Compose and Balena via the method shown here: https://github.com/PLCnext/Docker_GettingStarted
Ive been trying the following:
docker-compose --host unix:///var/run/balena-engine.sock up
Which errors out with the following:
Building NAME
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
However, I can build images and start containers just fine, including the specific items I’m trying to build with this command. I’ve also tested my compose file with a Docker Installation on my own (win 10)laptop, and it builds just fine there. Not using the --host flag produces a massive traceback which apparently means something similar (but this should look for a nonexistant docker.sock if I’m not mistaken). I’ve also tried reinstalling via the same method in the github, with no dice.

If anyone has any tips, they would be much appreciated!

Regards,

Small update! After a bit of recent testing I believe the issue is that, for whatever reason, the dockerfile build process wants to use the docker socket instead of the one supplied via the host command. Other docker-compose commands with the host option return expected results, so that part has to be working. I can’t for the life of me figure out how to make it explicitly try the balena-engine socket instead though, so if there is any advice on that front I would love to hear it!

Hey,
we install docker-compose ourselves in a container and pass the commands to that container. To distinguish docker and balena and not need the host flag, we mount the socket from docker and balena to docker in the container.
Host: balena.sock → Container: docker.sock
Host: docker.sock → Container: balena.sock

In the container only the container.sock exists as a link.
If a different behavior is desired here, the setup.sh must be adapted. The corresponding line will be created with:

sed -i ‚s/$DOCKER_HOST:$DOCKER_HOST/$DOCKER_HOST:/var/run/docker.sock/g‘ /usr/bin/docker-compose

Greetings,
Jan

Hey Jan,

The default behavior would probably be fine for me, if it actually worked… I figured I might’ve messed something up with all the tinkering I did to try and get it to work, so I did a type 1 reset and reinstalled Balena and Docker-Compose. See file attached for the outputs of the commands. A cursory google search for the traceback seems to indicate that the socket isnt available in the container, for whatever reason. Did I do something wrong here somehow?
(small note, I restarted my session after this because the balena command wasnt being recognized at first, did balena info and got the expected response, then tried compose again and same traceback)
Regards,
command outputs.txt

command outputs.txt

Just bumping this topic.

Sorry for the delay. I guess Jan is busy.
Here is a suggestion I just got from someone else:
Here are some more ideas to check: 1. after the type 1 reset some cached files from balena are not deleted. Please delete ‚/media/rfs/rw/var/lib/balena‘. 2. run ‚ls /var/run/‘ and check if the balena-engine.sock is available 3. run ‚nano /usr/bin/docker-compose‘ and check if the value of the variable DOCKER_HOST points to that socket file. (somewhere around line 24)You could also open an issue on the Github project, where you should get a reply from the developers of the installation script.

Hey,
I have found the error after a long search.
Originally there was no official build of compose for ARM, so we used a user build. Since version 2.x.x there is an official ARM version.
In the last version 1.x.x there were breaking changes in the official installscript, which were not updated in the userbuild for arm. Hence the incompatibility that occurred.
The error is in the automated transfer of parameters and a in parameter change that regards our install script.

Bugfix:
- Update compose to version 2.2.3 official build
- add env for belana in profiles and enviremont for DOCKER_HOST
- compose in container for compose not longer needed

After install a relogin is required to load the new enviroment.

Repo update is scheduled for 8.6.2022.

Update is released.

hello
I met the same issue , What do I have to enter to be successful
image.png

Here is a video showing the successful installation of balena-engine and the arm32v7/debian image, on an AXC F 2152 FW 2022.3.
Installing Balena Engine

image.pngsorry, i dont know the command for change directory from 0:34 to 0:35, i try the command : ’ cd’, it’s not successfull, Sorry, I’m new to putty and basic commands

The controller was actually restarted between 0:34 and 0:35.
It’s not necessary to change directory before pulling an OCI image, but this is possible using the cd command, e.g. cd /opt/plcnext
Starting from the beginning, after a Type 1 reset:
What firmware version is running on the controller?
Do all your installation steps look identical to the steps in the video, up to the point where the problem happens?

Sorry for my late reply! I was working on other stuff while waiting for a reply here and missed it earlier. With the update, the issue seems to have been resolved! Thank you so much for your time and effort, Jan and Martin!

Regards,

image.pngsorry sir, it took me more than 1 month to install docker still not working, from 0:34 to 0:35 in the video, i type sudo recover plcnext 1 to reset type 1 and continue, but still not working, Can you specify the command lines you use from 0:34 to 0:35?
i’m using the latest firmware

[https://forum.plcnext-community.net/uploads/K01E7DZYOYCU/image.png</a></p>sorry sir, it took me more than 1 month to install docker still not working, from 0:34 to 0:35 in the video, i type sudo recover plcnext 1 to reset type 1 and continue, but still not working, Can you specify the command lines you use from 0:34 to 0:35?</p>i’m using the latest firmware</p>

thanks, i have installed succesfully