# Multicontainer and multiple repos

**URL:** <https://forums.balena.io/t/multicontainer-and-multiple-repos/2924>\
**Category:** Product support\
**Created:** [April 14, 2018, 5:14am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924 "2018-04-14T05:14:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaquadro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jaquadro/32/909_2.png) [@jaquadro](https://forums.balena.io/u/jaquadro)\
**Post date:** [April 14, 2018, 5:14am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/1 "2018-04-14T05:14:17Z")

</div>

Hello,

I’m trying to migrate our gateway architecture for [resin.io](http://resin.io). This is currently made up of separate node applications that are each backed by their own repo on github. Is there any way to make use of multiple repos with the multicontainer feature?

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [April 14, 2018, 10:00am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/4 "2018-04-14T10:00:40Z")

</div>

That is exactly what I am experimenting with these days. Each service in our `docker-compose.yml` has its own repo. Then we have some CI triggering on every commit to `master`, whose job is to build and push the Docker image to a registry (Docker Hub or a private one). Finally the Resin app only consists of a `docker-compose.yml` that references the images and pulls them from the registry.

Does that make sense?

Something like:

```
version: '2'

# A simple POC for a multicontainer version of the Medusa app.

services:
  medusa-model:
    image: <registry>/<repository>/medusa-model-dummy:0cb9c7c45dda5a59b82525a2d0acd0dc4ab382e9
    environment:
      - PYTHONUNBUFFERED=true
    depends_on:
      - medusa-manager

  medusa-manager:
    image: <registry>/<repository>/medusa-manager-dummy:5cd87c6d234baffee309f7cc25857f7efcd60c64
    environment:
      - PYTHONUNBUFFERED=true

```

Note that I have to specify the version of each image, as it shows up in the registry (the commit SHA in our case). Otherwise `git push resin master` does not detect any change and does not update the app on the devices, even when a new version of a service is available.

---

<div class="post-metadata">

**Author:** ![mediainbox](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mediainbox](https://forums.balena.io/u/mediainbox)\
**Post date:** [April 14, 2018, 11:06pm UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/5 "2018-04-14T23:06:39Z")

</div>

Same here, Multicontainer don’t support GIT SUBMODULES, this is really important feature, to made Multicontainer easy to use

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [April 16, 2018, 7:18am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/6 "2018-04-16T07:18:00Z")

</div>

@mediainbox, is this something you have tested yourself?

EDIT: I can confirm submodules are not supported. I failed to migrate [https://github.com/resin-io-projects/multicontainer-getting-started](https://github.com/resin-io-projects/multicontainer-getting-started) to a submodules approach. `git push resin master` indeed fails with:

```
➜ main-application git:(master) git push resin master --force
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 830 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 3 (delta 0)

[Info] Starting build for XXX, user XXX
[Info] Dashboard link: https://dashboard.resin.io/apps/XXX/devices
[Info] Building on arm01
[Info] Pulling previous images for caching purposes...
[Success] Successfully pulled cache images
[Error] Some services failed to build:
[Error] Service: frontend
[Error] Error: Cannot locate specified Dockerfile: Dockerfile
[Error] Service: proxy
[Error] Error: Cannot locate specified Dockerfile: Dockerfile
[Error] Service: data
[Error] Error: Cannot locate specified Dockerfile: Dockerfile
[Error] Not deploying release.

remote: error: hook declined to update refs/heads/master
To XXX@git.resin.io:XXX/XXX.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'XXX@git.resin.io:XXX/XXX.git'

```

That is a shame. Submodules could prove a far better alternative.

It looks like the submodules are not cloned when the `master` branch is checked out on Resin’s build server, while it should be the case on the latest versions of Git.

Anyone from Resin can confirm this, and check which version of Git is used on the build farm?

EDIT2: The latest version of Git might be installed already. However, `git clone` and `git checkout` do not clone or update the submodules automatically as I though initially. One needs to explicitly add options like `git clone --recurse-submodules` or `git submodule update --recursive`.

---

<div class="post-metadata">

**Author:** ![jaquadro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jaquadro/32/909_2.png) [@jaquadro](https://forums.balena.io/u/jaquadro)\
**Post date:** [April 17, 2018, 1:08am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/8 "2018-04-17T01:08:08Z")

</div>

Are you able to pull any of your images from a private repo?

I think I’m most of the way to implementing this model, but I’m currently hung up on trying to authenticate a private repo.

---

<div class="post-metadata">

**Author:** ![lv82](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lv82/32/1044_2.png) [@lv82](https://forums.balena.io/u/lv82)\
**Post date:** [April 17, 2018, 7:10am UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/9 "2018-04-17T07:10:37Z")

</div>

Good question. I have been using public Docker Hub repos so far.

---

<div class="post-metadata">

**Author:** ![afitzek](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/afitzek/32/359_2.png) [@afitzek](https://forums.balena.io/u/afitzek)\
**Post date:** [April 17, 2018, 2:29pm UTC](https://forums.balena.io/t/multicontainer-and-multiple-repos/2924/14 "2018-04-17T14:29:48Z")

</div>

Hi,  
At the moment this is not supported, but we are working on a method to support this, which can be tracked in this issue: [https://github.com/resin-io/resin-cli/issues/843](https://github.com/resin-io/resin-cli/issues/843)  
This should be release soon.  
Best,  
Andreas
