Details
-
Type:
Task
-
Status: Open
-
Priority:
(None)
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: docker-compose support, docker-compose: Update Module
-
Labels:
-
Story Points:13
-
Epic Link:
-
Backlog:yes
-
Days in progress:0
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:
- 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.
- Find out digest of pulled image (either docker images --digests or docker inspect).
- 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.
- Pull image mentioned in value.
- 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" ] }
- All image keys from the docker-compose file
- 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!
- 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
- is blocked by
-
MEN-3836 docker-compose Update Module repository
-
- Open
-