# \#docker-compose

**URL:** https://forums.balena.io/tag/docker-compose/106.md

[Latest](https://forums.balena.io/latest.md) · [Categories](https://forums.balena.io/categories.md) · [Tags](https://forums.balena.io/tags.md)

---

## [USB hotplug for USB serial devices](https://forums.balena.io/t/usb-hotplug-for-usb-serial-devices/375570)

<div class="topic-metadata">

**Author:** [@benfrancis](https://forums.balena.io/u/benfrancis)\
**Replies:** 13\
**Last updated:** [July 21, 2026, 2:23pm UTC](https://forums.balena.io/t/usb-hotplug-for-usb-serial-devices/375570 "2026-07-21T14:23:15Z")

</div>

What is the current recommended way to handle USB serial devices being plugged in? I am working on porting an open source IoT gateway to balenaOS for the commercial pilot of an IoT hub product. The gateway has an add-on…

---

## [Shared memory between container - docker-compose](https://forums.balena.io/t/shared-memory-between-container-docker-compose/314435)

<div class="topic-metadata">

**Author:** [@eike](https://forums.balena.io/u/eike)\
**Replies:** 4\
**Last updated:** [May 28, 2025, 7:48pm UTC](https://forums.balena.io/t/shared-memory-between-container-docker-compose/314435 "2025-05-28T19:48:53Z")

</div>

I am trying to share memory between two containers by making container A’s memory shareable and allowing container B to access it. This works outside of balena if I start the containers individually and use the followin…

---

## [compose build dependencies](https://forums.balena.io/t/compose-build-dependencies/370019)

<div class="topic-metadata">

**Author:** [@pateco](https://forums.balena.io/u/pateco)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 7:29pm UTC](https://forums.balena.io/t/compose-build-dependencies/370019 "2025-04-11T19:29:11Z")

</div>

version: '2.4' services: service-core: image: custom/service-core build: context: . dockerfile: service-core.dockerfile service-base: image: custom/service-base build: context: . …

---

## [Doubts about services sharing an image](https://forums.balena.io/t/doubts-about-services-sharing-an-image/373587)

<div class="topic-metadata">

**Author:** [@pmacfarlanePTL](https://forums.balena.io/u/pmacfarlanePTL)\
**Replies:** 1\
**Last updated:** [February 26, 2025, 12:36am UTC](https://forums.balena.io/t/doubts-about-services-sharing-an-image/373587 "2025-02-26T00:36:36Z")

</div>

I am using docker-compose to implement multiple services, and I’d like many of these services to share the same image. However, when I push this (to a device in local mode), it seems the image is getting built multiple t…

---

## [libreNMS compose issue.](https://forums.balena.io/t/librenms-compose-issue/372317)

<div class="topic-metadata">

**Author:** [@Megachip](https://forums.balena.io/u/Megachip)\
**Replies:** 1\
**Last updated:** [October 25, 2024, 2:38pm UTC](https://forums.balena.io/t/librenms-compose-issue/372317 "2024-10-25T14:38:49Z")

</div>

Im trying to build libreNMS, but compose file seems not compatible. It seems has issues with the name data/name should be object and the services data/services should NOT have additional properties attributes. Maybe so…

---

## [Use of local docker images for a local mode deployment](https://forums.balena.io/t/use-of-local-docker-images-for-a-local-mode-deployment/371397)

<div class="topic-metadata">

**Author:** [@bartjanszoon](https://forums.balena.io/u/bartjanszoon)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 5:37am UTC](https://forums.balena.io/t/use-of-local-docker-images-for-a-local-mode-deployment/371397 "2024-09-26T05:37:44Z")

</div>

Hi, I’m trying to do local development but also want to use prebuilt images. I’m hoping to be able to push a docker-compose file that only contains images for the different services, so that balena doesn’t try to rebui…

---

## [Options for simulating/supporting depends\_on service\_healthy in balenaOS](https://forums.balena.io/t/options-for-simulating-supporting-depends-on-service-healthy-in-balenaos/370210)

<div class="topic-metadata">

**Author:** [@Panos](https://forums.balena.io/u/Panos)\
**Replies:** 0\
**Last updated:** [March 30, 2024, 1:15pm UTC](https://forums.balena.io/t/options-for-simulating-supporting-depends-on-service-healthy-in-balenaos/370210 "2024-03-30T13:15:01Z")

</div>

Hello everyone, I’m working on getting my project running on balenaOS, for deployment to RPi 5s/NUCs. The project consists of 5 Docker containers in a Docker-compose file that need to be started in a specific order and …

---

## [Help with Expanding Environment Variables in Dockerfile.template from docker-compose.yml](https://forums.balena.io/t/help-with-expanding-environment-variables-in-dockerfile-template-from-docker-compose-yml/370166)

<div class="topic-metadata">

**Author:** [@matialvarezs](https://forums.balena.io/u/matialvarezs)\
**Replies:** 0\
**Last updated:** [March 23, 2024, 2:09pm UTC](https://forums.balena.io/t/help-with-expanding-environment-variables-in-dockerfile-template-from-docker-compose-yml/370166 "2024-03-23T14:09:42Z")

</div>

Hello, I’m currently working on a project where I need to pass environment variables (PIP\_USERNAME and PIP\_PASSWORD) from a docker-compose.yml file to a Dockerfile.template for a build process on a Raspberry Pi 3. My se…

---

## [Configure docker compose from the device/fleet's Env](https://forums.balena.io/t/configure-docker-compose-from-the-device-fleets-env/370093)

<div class="topic-metadata">

**Author:** [@zukoo](https://forums.balena.io/u/zukoo)\
**Replies:** 3\
**Last updated:** [March 13, 2024, 1:03am UTC](https://forums.balena.io/t/configure-docker-compose-from-the-device-fleets-env/370093 "2024-03-13T01:03:48Z")

</div>

Hello! I’m new to balena, and enjoying it very much, I’m using it to build my own cloud for some compute batch jobs. The setup is straight forward: I have a container pulling work from a queue. As I’m adding new devic…

---

## [\[docker-compose\] start a subset of services, aka, service "profile"](https://forums.balena.io/t/docker-compose-start-a-subset-of-services-aka-service-profile/353515)

<div class="topic-metadata">

**Author:** [@AndMaz](https://forums.balena.io/u/AndMaz)\
**Replies:** 1\
**Last updated:** [April 22, 2022, 12:04pm UTC](https://forums.balena.io/t/docker-compose-start-a-subset-of-services-aka-service-profile/353515 "2022-04-22T12:04:21Z")

</div>

Hi Recent versions of docker-compose support “profile” attribute that allows to selectively start a subset of services declared in the docker-compose file. More info here: https://docs.docker.com/compose/profiles/ Fro…

---

## [deploy 2 docker-compose.yml without replacing them](https://forums.balena.io/t/deploy-2-docker-compose-yml-without-replacing-them/369390)

<div class="topic-metadata">

**Author:** [@matialvarezs](https://forums.balena.io/u/matialvarezs)\
**Replies:** 0\
**Last updated:** [November 21, 2023, 9:54pm UTC](https://forums.balena.io/t/deploy-2-docker-compose-yml-without-replacing-them/369390 "2023-11-21T21:54:17Z")

</div>

Hello everyone, A few days ago, I started using openbalena, I had seen it a long time ago, but now I see that it is very useful and I am really liking it. I have some questions yes and I would like you to help me clarif…

---

## [Google assistant on Balena](https://forums.balena.io/t/google-assistant-on-balena/15534)

<div class="topic-metadata">

**Author:** [@janvda](https://forums.balena.io/u/janvda)\
**Replies:** 4\
**Last updated:** [July 25, 2023, 9:52pm UTC](https://forums.balena.io/t/google-assistant-on-balena/15534 "2023-07-25T21:52:40Z")

</div>

I managed to install the google assistant client software on a raspberry pi 3 with balena. So I turned my pi in a kind of google home smart speaker. The only extra hardware you need is an earphone (or headphone) that …

---

## [REUPLOAD: PyGObject NM (NetworkManager?) not found/available inside container.](https://forums.balena.io/t/reupload-pygobject-nm-networkmanager-not-found-available-inside-container/365420)

<div class="topic-metadata">

**Author:** [@VromansN](https://forums.balena.io/u/VromansN)\
**Replies:** 1\
**Last updated:** [August 10, 2023, 12:26am UTC](https://forums.balena.io/t/reupload-pygobject-nm-networkmanager-not-found-available-inside-container/365420 "2023-08-10T00:26:32Z")

</div>

ORIGINAL I’m trying to get the device’s network info inside a container running on balenaOS 2.94.4 (supervisor version 14.3.3) on a Raspberry Pi Compute Module 4 using PyGObject (using Python 3.9.2). I’ve been using th…

---

## [Getting GPIO to work in container](https://forums.balena.io/t/getting-gpio-to-work-in-container/367928)

<div class="topic-metadata">

**Author:** [@watertube](https://forums.balena.io/u/watertube)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 6:24am UTC](https://forums.balena.io/t/getting-gpio-to-work-in-container/367928 "2023-05-18T06:24:16Z")

</div>

Question I am trying to access the GPIO pins using the Python module gpiozero, from within a container. gpiozero can work with several low level libraries - or pin factories. I tried several, and the all give problems …

---

## [Balena USB interface](https://forums.balena.io/t/balena-usb-interface/366651)

<div class="topic-metadata">

**Author:** [@tv12345](https://forums.balena.io/u/tv12345)\
**Replies:** 0\
**Last updated:** [February 11, 2023, 5:25pm UTC](https://forums.balena.io/t/balena-usb-interface/366651 "2023-02-11T17:25:02Z")

</div>

Hello, I am facing an issue running an AT command python script on the Balena environment. The script works fine on a normal Raspbian environment, but when deployed on Balena it gives error:- serial.serialutil.SerialEx…

---

## [Container does not restart on failure](https://forums.balena.io/t/container-does-not-restart-on-failure/366552)

<div class="topic-metadata">

**Author:** [@AndMaz](https://forums.balena.io/u/AndMaz)\
**Replies:** 1\
**Last updated:** [February 8, 2023, 7:16pm UTC](https://forums.balena.io/t/container-does-not-restart-on-failure/366552 "2023-02-08T19:16:13Z")

</div>

I have a docker-compose file with a single service (FROM balenalib/%%BALENA\_ARCH%%-debian-node:16-buster-build) with a restart: always flag enabled. In latest release of my nodejs app there was was a memory leak that ca…

---

## [Balena multiple services and docker "layer deduplication"?](https://forums.balena.io/t/balena-multiple-services-and-docker-layer-deduplication/366411)

<div class="topic-metadata">

**Author:** [@luchko](https://forums.balena.io/u/luchko)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 8:11pm UTC](https://forums.balena.io/t/balena-multiple-services-and-docker-layer-deduplication/366411 "2023-01-16T20:11:25Z")

</div>

Hello, I do not feel comfortable with advanced docker stuff, but i was wondering something : can balena achieve some optimization when docker-composed services share some layers? As an explanantion, see example below: …

---

## [cap\_add needed to detect usb device](https://forums.balena.io/t/cap-add-needed-to-detect-usb-device/354155)

<div class="topic-metadata">

**Author:** [@richard.galvez](https://forums.balena.io/u/richard.galvez)\
**Replies:** 3\
**Last updated:** [December 26, 2022, 10:05pm UTC](https://forums.balena.io/t/cap-add-needed-to-detect-usb-device/354155 "2022-12-26T22:05:20Z")

</div>

Hello– I have a multicontainer app that is finally able to detect a Google coral connected through USB. The issue is that the first time it checks for the device it throws an error (I’d include, but suffice to say it do…

---

## [Deploy webrtc on rpi 4](https://forums.balena.io/t/deploy-webrtc-on-rpi-4/362399)

<div class="topic-metadata">

**Author:** [@thomiyi](https://forums.balena.io/u/thomiyi)\
**Replies:** 6\
**Last updated:** [October 25, 2022, 11:03pm UTC](https://forums.balena.io/t/deploy-webrtc-on-rpi-4/362399 "2022-10-25T23:03:48Z")

</div>

hello i try to deploy a angular server on a rpi4 but i have a problem with a webrtc feature but when i deploy my server i have an error “navigator.mediaDevices” is undifined FROM balenalib/%%BALENA\_ARCH%%-node:14-bust…

---

## [Ignore unavailable devices in docker-compose](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234)

<div class="topic-metadata">

**Author:** [@shawaj](https://forums.balena.io/u/shawaj)\
**Replies:** 3\
**Last updated:** [June 29, 2022, 7:03pm UTC](https://forums.balena.io/t/ignore-unavailable-devices-in-docker-compose/350234 "2022-06-29T19:03:54Z")

</div>

If I put the following on a device that has i2c bus 1 and 7 on the host (RockPi) it builds and runs successfully: devices: - /dev/i2c-7:/dev/i2c-7 - /dev/i2c-1:/dev/i2c-1 However if I deploy this to a raspb…

---

## [docker-compose - exec format error](https://forums.balena.io/t/docker-compose-exec-format-error/358387)

<div class="topic-metadata">

**Author:** [@RonaldGuilhermePDS](https://forums.balena.io/u/RonaldGuilhermePDS)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 6:58am UTC](https://forums.balena.io/t/docker-compose-exec-format-error/358387 "2022-06-01T06:58:46Z")

</div>

Hey there! I’m running raspbian os on a raspberry pi 3 and following the openBalena documentation I came across the following error: how to proceed?

---

## [Specify a docker-compose.yml file for balena deploy](https://forums.balena.io/t/specify-a-docker-compose-yml-file-for-balena-deploy/350232)

<div class="topic-metadata">

**Author:** [@shawaj](https://forums.balena.io/u/shawaj)\
**Replies:** 3\
**Last updated:** [May 6, 2022, 10:48am UTC](https://forums.balena.io/t/specify-a-docker-compose-yml-file-for-balena-deploy/350232 "2022-05-06T10:48:45Z")

</div>

Is it possible to specify one or more docker-compose.yml files to balena deploy? For example with docker it’s possible to do: docker-compose -f a.yml Or you can use multiple like: docker-compose -f a.yml -f b.yml A…

---

## [BalenaOS use Raspberry Pi Compute Module 4 IO board's Real-Time Clock inside container.](https://forums.balena.io/t/balenaos-use-raspberry-pi-compute-module-4-io-boards-real-time-clock-inside-container/355610)

<div class="topic-metadata">

**Author:** [@VromansN](https://forums.balena.io/u/VromansN)\
**Replies:** 6\
**Last updated:** [April 13, 2022, 3:12pm UTC](https://forums.balena.io/t/balenaos-use-raspberry-pi-compute-module-4-io-boards-real-time-clock-inside-container/355610 "2022-04-13T15:12:39Z")

</div>

I’m trying to use the CM4 IO board’s Real-Time Clock (RTC) to persist datetime changes from within a docker container, so whenever the device reboots, it remembers the newly set datetime. (By default it syncs via chrony.…

---

## [PyGObject NM (NetworkManager?) not found/available inside container.](https://forums.balena.io/t/pygobject-nm-networkmanager-not-found-available-inside-container/355357)

<div class="topic-metadata">

**Author:** [@VromansN](https://forums.balena.io/u/VromansN)\
**Replies:** 0\
**Last updated:** [March 29, 2022, 8:50am UTC](https://forums.balena.io/t/pygobject-nm-networkmanager-not-found-available-inside-container/355357 "2022-03-29T08:50:41Z")

</div>

I’m trying to get the device’s network info inside a container running on balenaOS 2.94.4 (supervisor version 12.11.43) on a Raspberry Pi 4 (4GB version, Rev1.2) using PyGObject (using Python 3.9.2). I’ve been using the…

---

## [Secrets and deployments for unique locations](https://forums.balena.io/t/secrets-and-deployments-for-unique-locations/352054)

<div class="topic-metadata">

**Author:** [@jordan-lumley](https://forums.balena.io/u/jordan-lumley)\
**Replies:** 3\
**Last updated:** [February 18, 2022, 1:42pm UTC](https://forums.balena.io/t/secrets-and-deployments-for-unique-locations/352054 "2022-02-18T13:42:40Z")

</div>

Hey all, So I am using balena for distributed software and I’m wondering if any of you other users are using this for a similar situation. So each location that the docker container will be deployed to will need to hav…

---

## [s3 is exiting with code 255 after startup with ./scripts/compose up](https://forums.balena.io/t/s3-is-exiting-with-code-255-after-startup-with-scripts-compose-up/180828)

<div class="topic-metadata">

**Author:** [@linus\_h](https://forums.balena.io/u/linus_h)\
**Replies:** 14\
**Last updated:** [November 5, 2021, 2:33pm UTC](https://forums.balena.io/t/s3-is-exiting-with-code-255-after-startup-with-scripts-compose-up/180828 "2021-11-05T14:33:33Z")

</div>

I really don’t know what’s happening here. It seems like the s3 container dies instantly, so that the registry container follows with code 255 (like the s3 container), so that HAProxy won’t start, because the hostnames c…

---

## [BalenaOS vs Ubuntu vs k3os](https://forums.balena.io/t/balenaos-vs-ubuntu-vs-k3os/342578)

<div class="topic-metadata">

**Author:** [@pcorbel](https://forums.balena.io/u/pcorbel)\
**Replies:** 7\
**Last updated:** [August 4, 2021, 4:34pm UTC](https://forums.balena.io/t/balenaos-vs-ubuntu-vs-k3os/342578 "2021-08-04T16:34:45Z")

</div>

Hello everybody :wave:, First I wanted to thanks Balena for their amazing work :pray: and this community too for being there and making Balena a great product to work with :sparkles:. As you can guess, I’m a passionate…

---

## [Multi container balena devices.](https://forums.balena.io/t/multi-container-balena-devices/235750)

<div class="topic-metadata">

**Author:** [@whiggs](https://forums.balena.io/u/whiggs)\
**Replies:** 3\
**Last updated:** [April 22, 2021, 10:34am UTC](https://forums.balena.io/t/multi-container-balena-devices/235750 "2021-04-22T10:34:35Z")

</div>

Hello all. So, I have seen that you can create multiple containers within a particular balena app using docker-compose. However, the docker-compose files examples given appear to define a service and a dependency serv…

---

## [Pass balena hostname to container](https://forums.balena.io/t/pass-balena-hostname-to-container/278693)

<div class="topic-metadata">

**Author:** [@lucas.bodnyk](https://forums.balena.io/u/lucas.bodnyk)\
**Replies:** 2\
**Last updated:** [April 6, 2021, 2:48pm UTC](https://forums.balena.io/t/pass-balena-hostname-to-container/278693 "2021-04-06T14:48:03Z")

</div>

I want a container to have an environment variable with the host’s hostname (AKA the uuid) as the value. Unfortunately, hostname is not an environment variable. How might I accomplish this? I’m really hoping there’s a w…

---

## [Balena push does not use cache](https://forums.balena.io/t/balena-push-does-not-use-cache/271223)

<div class="topic-metadata">

**Author:** [@tobyhijzen](https://forums.balena.io/u/tobyhijzen)\
**Replies:** 3\
**Last updated:** [March 18, 2021, 3:51pm UTC](https://forums.balena.io/t/balena-push-does-not-use-cache/271223 "2021-03-18T15:51:23Z")

</div>

Dear support, We are in the process of creating a release. However when pushing the release for testing to a device in local mode with 'balena push ’ one of the services is rebuild everytime even though nothing changes.…

[Next page](https://forums.balena.io/tag/docker-compose/106.md?match_all_tags=true&page=1&tags%5B%5D=docker-compose)
