1. Home
  2. Categories
  3. Docker Applications
  4. Docker Application Development

Docker Application Development

Docker Development

Barbara OS supports docker containers, to deploy and run them, Barbara OS use docker-compose under the hood to orchestrate everything.

Barbara OS requires that docker app files and folders be structured concretely inside the ZIP file that should be used to upload the app to Barbara Panel.

  1. Docker-compose YAML file can only be named docker-compose.yaml or docker-compose.yml, otherwise, docker installation will fail.
  2. All persistence files/folders must be placed inside a “persist” folder in the ZIP root folder, any other file/folder could be used to build containers but will be replaced/deleted if the docker app is updated
  3. Native docker volumes are not yet allowed
  4. Only bind mounts are allowed, but only if that mount point (host side) contains “./persist/”, “./appconfig” or “./sys/”  at the beginning.
  5. Privileged containers are not allowed
  6. Admin-related capabilities are not allowed
  7. Devices access must be declared explicitly

This is a docker-compose.yaml example:

version: '3.8'

services:
    logApp:
        build: .
        restart: "unless-stopped"
        volumes:
            - "./appconfig/:/appconfig/"
            - "./sys/:/sys/"
        devices:
            - /dev/gpiomem:/dev/gpiomem

Docker Apps examples

The following repositories contain docker application examples:

  1. Apache: A simple docker container running an Apache web server with a basic web inside.
  2. Golang: Container example showing how to build an example Golang app that will show Docker logs based on appconfig values

Every Docker example contains an appconfig sample to be able to interact with the Docker from Barbara Panel

Barbara OS Docker tips

  1. You must be aware of the platform of the Barbara OS device, and the Docker images platform/architecture compatibility, some deployments can run on a PC (x86_64) but not inside a Raspberry Pi 3 (armv7)
  2. Here are some Barbara OS groups gid, needed in some cases by Docker apps to get access to some devices:
    • gpio – 10000
    • spi – 117
    • i2c – 115
    • kmem – 9
  3. If your docker image needs specific permissions for your persistence folder, please contact Barbara’s support team to help you.

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support