Using zip from node-red in docker container fails

Sorry if this is more like a docker question than node-red.
I'm porting my node-red flows from pi4 to pi5 where I'm now using docker. It runs fine, except when trying to execute daily backup zip, It looks like zip is not available inside the docker container. Even if I'm getting into the container in console and type zip, I just get command not found. However, exiting the container the same command works fine.

I'm just starting to learn docker but am a long time user of node-red and I understand that the container is kind of isolated from the main os (debian in this case). But I guess there is a solution available.

Thanks in advance for any help.

then the container does not have zip installed.

what are you backing up? Flows?

you could simply install a zip node and perform the zipping inside a flow then push the final zipped binary to a file or server or wherever.

Yes, flows but also some data etc to Dropbox. I thought there could be such a node available, thanks for the suggestion. But trying to understand the docker concept, I wonder how you would be able to utilize external tools outside the container.

You can't. You can access external files/folders by using Volumes, but not tools (as far as I know). If you want to do that then don't use Docker.

Or, learn how to create your own docker image and build the required tools into the image/container.

TBF, it might already have tar (as opposed to zip) in the container (pretty sure alpine has a busybox tar variant)

You are right, tar is there. Maybe I need to use that while looking on how to build a docker of my own.

Many thanks to both of you for you guidance!

If all you need is zip id just install it on the node-red container your using

foo@foo1:~$ docker ps

Make sure to change the container ID to the one you got in the output above

foo@foo1:~$ docker exec -it 4751e25af602 bash

Then try to install zip

apk add --upgrade zip

Now if you want to get real fancy and save a copy of this new container for spining up later

commit changes to a new docker image remember to change the the container ID to the one you got above

$ docker container commit -a "chosenNameHere" -m "Changed default nodered" 4751e25af602 nodered/customimage:1.0.1

Now you can use nodered/customimage:1.0.1 insted of nodered/node-red:3.1.3-18

mind you I have not done any of this but it is how id go about it.

Many thanks for this info @meeki007. I will try it.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.