# How to include git in a Node-RED Docker Instance

**URL:** https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896
**Category:** General
**Created:** [9 March 2020 21:44 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896 "2020-03-09T21:44:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![fissionregalia](https://avatars.discourse-cdn.com/v4/letter/f/9f8e36/32.png) [@fissionregalia](https://discourse.nodered.org/u/fissionregalia)
#### Post date: [9 March 2020 21:44 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/1 "2020-03-09T21:44:08Z")

</div>

I'm trying to install node-red-contrib-smartthings node from @otaviojr but am running into some issues. I'm currently running node-red in docker via docker-compose and I can't seem to figure out how to add git after the fact to the container. I do have git installed to the host system, but that isn't helping.

The reason why I need to install git is because that is apparently how this node was coded. After reviewing [this thread](https://discourse.nodered.org/t/node-red-contrib-smartthings/17399) as well as the issues page on @otaviojr github, it looks like the the solution is to just install git. Except I can't seem to figure out how to do that.

(this post was pretty heavily edited from the original that was split from another topic)

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 March 2020 21:53 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/2 "2020-03-09T21:53:35Z")

</div>

Well, this is really a new thread and should be started as such if you want to carry on (I think I can move it if you want me to).

Yes, you need to have everything you need inside the container. Or you can compose several containers together so that they share various resources. Rather beyond the reach of this forum probably though.

---

<div class="post-metadata">

### Author: ![fissionregalia](https://avatars.discourse-cdn.com/v4/letter/f/9f8e36/32.png) [@fissionregalia](https://discourse.nodered.org/u/fissionregalia)
#### Post date: [9 March 2020 21:57 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/3 "2020-03-09T21:57:54Z")

</div>

It would probably be best to move it since it is off-topic from what the OP posted for sure. Thank you!

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 March 2020 22:06 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/4 "2020-03-09T22:06:49Z")

</div>

... and like magic! Feel free to change the topic name if you like.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 March 2020 22:37 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/5 "2020-03-09T22:37:23Z")

</div>

If you have mounted your data directory outside of the container on the host (so it is preserved) then you may be able to mount it on the host side (where you have git) - and run the install that side.

---

<div class="post-metadata">

### Author: ![Mark\_Ellis](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mark_ellis/32/79062_2.png) [@Mark\_Ellis](https://discourse.nodered.org/u/Mark_Ellis)
#### Post date: [10 March 2020 09:34 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/6 "2020-03-10T09:34:49Z")

</div>

I have node red installed in a container, and i installed node-red-contrib-smartthings through the palette manager and it works fine, if you want to use git, you need to create a new config file on the host machine for node red, then copy that into the node red container replacing the old one, so node red knows where git is or install node red on the host machine, seems a lot of work for nothing.

---

<div class="post-metadata">

### Author: ![fissionregalia](https://avatars.discourse-cdn.com/v4/letter/f/9f8e36/32.png) [@fissionregalia](https://discourse.nodered.org/u/fissionregalia)
#### Post date: [10 March 2020 22:04 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/7 "2020-03-10T22:04:25Z")

</div>

> [@dceejay](#):
>
> If you have mounted your data directory outside of the container on the host (so it is preserved) then you may be able to mount it on the host side (where you have git) - and run the install that side.

This was a great suggestion. Worked perfectly.

> [@Mark\_Ellis](#):
>
> seems a lot of work for nothing.

Lmao couldn't agree more. Cheers!

---

<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: [24 March 2020 22:05 UTC](https://discourse.nodered.org/t/how-to-include-git-in-a-node-red-docker-instance/22896/8 "2020-03-24T22:05:14Z")

</div>

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