# Using zip from node-red in docker container fails

**URL:** <https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390>\
**Category:** General\
**Tags:** docker\
**Created:** [8 January 2024 12:20 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390 "2024-01-08T12:20:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 January 2024 12:20 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/1 "2024-01-08T12:20:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 January 2024 13:09 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/2 "2024-01-08T13:09:30Z")

</div>

> [@luotope](#):
>
> I'm getting into the container in console and type zip, I just get command not found.

then the container does not have `zip` installed.

> [@luotope](#):
>
> trying to execute daily backup zip

what are you backing up? Flows?

you _could_ simply install a [zip node](https://flows.nodered.org/search?term=zip&type=node) and perform the zipping inside a flow then push the final zipped binary to a file or server or wherever.

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 January 2024 16:28 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/3 "2024-01-08T16:28:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 January 2024 16:53 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/4 "2024-01-08T16:53:37Z")

</div>

> [@luotope](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 January 2024 17:14 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/5 "2024-01-08T17:14:48Z")

</div>

> [@Colin](#):
>
> 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)

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 January 2024 17:32 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/6 "2024-01-08T17:32:46Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![meeki007](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meeki007/32/12499_2.png) [@meeki007](https://discourse.nodered.org/u/meeki007)\
**Post date:** [9 January 2024 00:39 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/7 "2024-01-09T00:39:50Z")

</div>

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

```auto
foo@foo1:~$ docker ps

```

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

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

```

Then try to install zip

```auto
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

```auto
$ 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.

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [9 January 2024 06:19 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/8 "2024-01-09T06:19:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 March 2024 06:19 UTC](https://discourse.nodered.org/t/using-zip-from-node-red-in-docker-container-fails/84390/9 "2024-03-09T06:19:50Z")

</div>

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