I have been struggling to understand why a .tar docker image is not installing on Cisco IOx. I tested with an image that I had created back in 2021 and it worked flawlessly. I spent some time trying to understand the differences between the two .tar files, and noticed that:
the old .tar file from 2021 has a folder format that contains layers. My understanding is that this is the Docker Archive Format
the new .tar file that is created today via Docker has a blobs folder and is the OCI format
I have a specific need for a docker image file that is not in the OCI format. I cannot find an easy way to specify how to save a .tar file that is in the Docker Archive Format.
Does anyone know if this is possible, or is OCI the only format that is supported going forward?
I didn’t follow closely the image formats during the years, because I always had a recent enough image that I could use, but if you really need to start a container, you could run an older Docker version. For example using Docker in Docker: https://hub.docker.com/_/docker
Than if you want to conert it to a new version, the cleanest way would be building a new image after you copied out the required app files and configs, but if you don’t know how to build an image based on a newer base image compatible with the app, you could try using the command that many people use for the wrong goal: docker container export to get the container filesystem as a tar file and load it into an image in a new Docker environment, using docker image import. You would still need to set some metadata if any environment variable, entrypoint or CMD is needed that existed in the old image as the container export only exports the filesystem, so image import only imports the filesystem.
Maybe there is a tool that converts the old format to a new one. For example there is this comment:
Although the example shows converting loaded images to new formats. So if you find a Docker version that supports the old format, you can convert it to the new one and use docker image save and load that file into a new Docker environment using `docker image load.