Docker-compose images in GitHub CI/CD

Hi all!

As an evaluation of the complete Mender platform, I am trying some workflows as they would have been implemented in a production environment, which is not (yet) the case at this moment.
Using multiple of the docs, tutorials and blog posts, I created an easy device onboarding script which installs the mender-client4, mender-update etc.

The most important way of updating our software would be using a docker-compose file in which containers are added/removed or where container versions are altered.
Using the ‘Tutorial: Docker Compose update’, I was able to do a first test doing so using Mender. The tutorial walked me to all the steps smoothly, thanks for that!

However, I was wondering why the exact images included in the docker-compose file, also have to be mentioned in the app-gen command using --image parameter? I took this example from the tutorial:

app-gen
        -- <other params>
        -- image docker.io/library/traefik:v2.9 \	# This is mentioned already in the docker-compose file
        -- image docker.io/traefik/whoami:latest \  # This is mentioned already in the docker-compose file
        -- <other params>

To take it a step further, I also took a look at CI/CD integration. I have a working draft version which simply builds the docker-compose file and uploads the artifact to the Mender platform.
However, I had to hard-code the ‘–image’ parameters in the CI/CD yaml. For me to be useful, it would make sense if the --image parameters are dropped and the artifact is generated from the descriptions in the docker-compose alone.

Am I missing something obvious here?

Cheers!

Hi @GoethalsRobbe,

Thanks a lot for getting in touch, and glad to hear the module is working so well for you. After looking at the app-gen source code, I don’t think the automatic extraction of the image list is currently supported. I’d think that at least for simpler manifests, this should be doable. For more complex setups, I can’t tell (not much of a container guy, sorry).
I personally would just grab the app-gen source and extend it as required for your use case. It is by no means set in stone.

Greets,
Josef

1 Like

Hi Josef

Thanks for taking a look.
I’ll see what I can do to include this feature.

Kind regards
Robbe

1 Like

As a reference for future readers: automatic image extraction from the docker-compose.yaml file is now included in the app-gen script.

Thanks to @peter for the quick review and merge! :+1:

1 Like

amazin work man!

pg

2 Likes