Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-3837

docker-compose Update Module generator




      Acceptance criteria:

      • Created Update Module generator "docker-compose-artifact-gen".
      • How it should work:
        • Must support "--" syntax, like most generator, used to pass through arguments to mender-artifact.
        • Main argument is docker-compose file.
        • Scan for all image keys in docker-compose file.
          • If value ends with @sha256:XXXX..., then include verbatim.
          • If it does not, proceed to image pulling:
            1. Pull image mentioned in value.
              • If MEN-3850 has found a way to pull the digest without the image, use that, if not, use regular docker pull.
            2. Find out digest of pulled image (either docker images --digests or docker inspect).
            3. Tack the digest onto the end of the image value in the docker-compose file, prefixed with @sha256:, and use that in the docker-compose file.
        • Second mandatory argument is -d, giving directory on target system where the docker-compose file will live.
        • Optional flag, --unpinned, which skips pulling of images, and adds the image value from the docker-compose directly, without sha256 digest.
        • Meta-data is generated which contains the following data:
          • All image keys from the docker-compose file
            • This is only for visual purposes in the UI, it won't be used by the Update Module.
          • The directory given with the -d argument.
          • Example:
                "install_directory": "/var/docker-compose/my-app",
                "images": [
        • Artifact is generated which contains the modified docker-compose file, and the meta-data.
          • For convenience, it is ok to duplicate the install_directory in a plain text file in the payload data, so that the script does not have to parse JSON. But maybe Python YAML parser will be used which supports both.... It's up to the implementer!
        • If, and only if, docker pull fails, return error code 5 (this may be used by backend later).
      • Submitted to docker-compose-update-module repository from MEN-3836.


          Issue Links



              Unassigned Unassigned
              a10040 Kristian Amlie
              0 Vote for this issue
              3 Start watching this issue