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

docker-compose Update Module generator

    XMLWordPrintable

    Details

      Description

      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": [
                    "minio:1.2.3@sha256:38756893659837265897234658923469578",
                    "nginx:2.3.4@sha256:78945758334890572985784576348975893"
                ]
            }
            
        • 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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                a10040 Kristian Amlie
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel