Docker Apps
Before you can deploy your own Docker applications. You should have a basic understanding of Docker containers and images, and creating Docker applications using Docker-Compose files.
If your device is constrained in resources, consider removing some or all of the example apps. To remove an app, just delete the App Card by clicking on the "X" next to the app’s name.

How to delete an App
How to package a Docker application for deployment
Barbara Edge Node applications need to be packaged in zip files for being deployed to Edge Devices via Barbara Panel. The zip directory structure should include at least a docker-compose.yaml file in the root, but we highly recommend including at least a ./persist folder too.
Where:
docker-compose.yaml is the Docker Compose file, or the mail file that allows the Docker daemon to understand which services must be used as well as other details related to their orchestration. ./persist folder is the where all the content you want your app to keep is stored (e.g., binary files, certificates, etc.).
version: "3.3"
services:
dummy_container:
build: .
volumes:
- "./appconfig/:/appconfig/"
- "./persist/:/persist/"
env_file:
- .barbara_env
networks:
- barbaraServices
devices:
- /dev:/dev2
ports:
- 80:8090
networks:
barbaraServices:
driver: bridge
name: barbaraServices

How to zip a Docker App
Barbara Panel Docker tips and tricks
While creating the zip file, consider the following essential points:
- The Docker-compose YAML file can only be named
docker-compose.yamlordocker-compose.yml, otherwise, the Docker installation fails. - All persistence files/folders must be placed inside the
./persist folderfolder in the ZIP root folder. - You can add other files/folders into the zip to be used to build containers but note that they will be replaced/deleted if the Docker app is updated.
- Native Docker volumes are also allowed
- Only bind mounts are allowed, but only if that mount point (host side) contains
./persist/,./appconfig, or./sys/at the beginning. - Privileged containers are not allowed
- Admin-related capabilities are not allowed
- Device access must be declared explicitly, meaning you have to add the following text within your
docker-compose.yamlfile
Deploying your newly created app
Barbara Edge Node applications are organized in the Library view which can be accessed by the Library icon in the center of the upper bar in Barbara Panel.
- Once in the Library, select the “ADD NEW APP” button on the top right corner of the Panel, and fill in the necessary information. Ensure the “User Docker” checkbox is selected.

New app Popup
- Once the application is created, you can upload the zip file, which will be the first version of the application. Click on the name of the new application created, click the button “ADD NEW VERSION” and fill in the necessary information.

New version Popup
Congratulations! Your application is now ready to be deployed. You can proceed to deploy the app the same way you deployed the test applications included in the Starter Kit:
- Go to the Nodes view by clicking on the “NODES” button in the upper menu bar on Barbara Panel.
- Click on the Node you want to deploy the app to.
- Select **ADD CARD and choose User Docker application
- Select your application
- Enable the logs and check the status and logs of your deployment
If you have a problem while your application is starting, feel free to contact the Barbara support team.
Managing variables within your application (APP-CONFIG and SECRETS)
SECRETS, CREDENTIALS, GLOBAL APP-CONFIG, and LOCAL APP CONFIG are files that contain dynamic information that can be read from inside your application. Some examples are users and passwords to access your app (these must be in SECRETS or CREDENTIALS) or URLs, IPs, and ports your application needs to connect to (these can be in LOCAL or GLOBAL APP-CONFIG).
- CREDENTIALS are used to log into private Docker repositories so you can download images from them. They are not accessible from the apps, the system, or the Docker daemon.
- SECRETS are global variables you define in your Node and may be referenced from the different apps you install in your Node (our sample apps within the Starter Kit, for instance, establish several Secrets to configure each app). If you establish a Secret you can refer to it in your app’s code by using the Secret name as the variable name.

Establishing a secret

Referencing a secret
How your variables are organized is up to you, but if you have any questions while developing your apps feel free to contact Barbara's support team.
To ensure your SECRETS, GLOBAL, and LOCAL APP-CONFIG variables are accessible from your applications, the following Volume mounts need to be added to your applications Docker Compose YAML file:
version: "3.3"
services:
dummy_container:
build: .
volumes:
- "./appconfig/:/appconfig/"
- "./persist/:/persist/"
env_file:
- .barbara_env
networks:
- barbaraServices
devices:
- /dev:/dev2
ports:
- 80:8090
networks:
barbaraServices:
driver: bridge
name: barbaraServices
Once those volumes are mounted, you'll be able to access two files:
/appconfig/global.json/appconfig/appconfig.json
These files are kept updated with the content that you have in the Barbara Panel and react to the changes made, so you only need to add a function to the application that's in charge of reading those files and using the data for its configuration.
For example, if you add the following object to your Local App Config File and click on the "SEND" button:

App config dialog
You can access it from within your Docker container the same way you access a local JSON file. This is an example of a Python program accessing this variable:
import json
def read_appconfig():
filename = "/appconfig/appconfig.json"
f = open(filename)
app_config_data = json.load(f)
data = app_config_data["data"]
print(data)
data_object = app_config_data["data_object"]
data_in = data_object["data_in"]
print(data_in)
if __name__ == '__main__':
read_appconfig()
exampleData
exampleDataIn
Docker apps examples
The following repositories have Docker container examples
- Apache: A simple Docker container running an Apache web server with a basic web inside
- Golang: Container example showing how to build an example Golang app that will show Docker logs based on appconfig values
- Grafana/Influx/Node-Red (not compatible with armv7 devices) Docker compose that's a bit more complex than previous examples, showing how to use Barbara OS persist folders inside the three Docker containers built.
- Nodejs: This container example shows a basic Node.js app using appconfig to show different logs based on the appconfig value. Even the logs refresh time can be changed through appconfig.
Every Docker example contains an appconfig sample to be able to interact with the Docker app from Barbara Panel.