runtime-tools icon indicating copy to clipboard operation
runtime-tools copied to clipboard

Generate container config from image manifest

Open mathstuf opened this issue 7 years ago • 3 comments

It would be nice to be able to generate a config.json based on the output of docker inspect or podman inspect. Images (or containers) already have knowledge of things like exposed ports, commands to run, etc. and it'd be nice to be able to use that as a base for generating a config.json.

Example:

oci-runtime-tool generate --image image.json …

mathstuf avatar Oct 12 '18 01:10 mathstuf

I this it's a good idea, and I'm prepared to do this. As you said, before running this function we need a json file of the results of the docker inspect, and then we run the generate function on this basis to produce the new json file. Is my understanding correct?

zhouhao3 avatar Oct 17 '18 09:10 zhouhao3

Yes. I suspect there are multiple different formats out there (Docker-specific, OCIv1, probably others from other tools), but I think they all have a MIME type key in there somewhere to tell them apart from each other.

mathstuf avatar Oct 17 '18 13:10 mathstuf

Also nice would be converting a systemd.nspawn file into a config.json.

mathstuf avatar Oct 19 '18 12:10 mathstuf