Skip to content

A Docker Update Module to handle Docker image updates using docker compose.

License

Notifications You must be signed in to change notification settings

quartx-analytics/mender-docker-compose

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Mender Docker Compose Artifact

This action allows you to create artifacts to deploy docker containers to mender devices using docker compose.

Refer mender

Usage

See action.yml

See upload-artifact

Create Artifact

steps:
  - uses: actions/checkout@v2

  - id: mender
    name: Create mender artifact
    uses: quartx-analytics/[email protected]
    with:
      compose-file: "docker-compose.yml"
      software-name: "project-name"
      device-types: "raspberrypi3 raspberrypi4"
      signing-key: "${{ secrets.ARTIFACT_SIGNING_KEY }}"  # Optional
      compose-file-variables: "IMAGE_TAG=latest"  # Optional

  - name: Upload mender artifact
    uses: quartx-analytics/[email protected]
    with:
      artifact: ${{ steps.mender.outputs.artifact-file }}
      username: ${{ secrets.MENDER_USER }}
      password: ${{ secrets.MENDER_PASS }}

Here we specify the filename for the docker compose file, the file that contains all the details required to build the docker container(s). We also need to specify the software name, docker compose uses this for identifying the containers. The device-types are the devices that this artifact will be built for. The artifact will not work on any other device but what is specified. A signing-key can also be specified if required, this will ensure that the artifact has not been changed after creation. It will also force the artifact to only work on the mender server that contains the corresponding private key.

We can then our other action that can upload the mender artifact to a mender server. See upload-artifact

Notes

For the artifact to work on mender, all mender devices need to have docker compose installed. The docker-compose update module from this repo also needs to be placed in the /usr/share/mender/modules/v3 directory on all your mender devices.

License

The scripts and documentation in this project are released under the Apache License