I am using the docker-squash tool to solve a problem I am having. The problem is that I need a way to customize the environment variables of an older docker image, such as UID/GID and group and then run a startup script that fixes permissions according to these new environment variables so that they may be deployed to different cloud environments that have different environment requirements. If I just run the image I want customized through the customize docker file, this results in the image I wanted customized being much larger, since we have to fix permissions on directories in order to reflect the new env variables. Which is why squashing the image is a solution to this problem since it doesn't result in an increased size. The docker image is based off of jupyter stacks minimal image. The docker file for the base image is here. The docker file for the customize stage is here. The image I am trying to squash is located here.
The Problem
After using docker-squash to squash the image, I am unable to then push this squashed image to quay.io. However, I am able to run it and test it locally and everything is working as expected. The specific error I am getting when trying to push the squashed image is manifest invalid: manifest invalid. After looking further into it, I believe it is because the squashed image is not having its manifest being written correctly after being squashed. I believe this because when doing a docker manifest inspect on the image I get this output no such manifest: quay.io/opeffort/ope-test:base-ope-image-test-custom-base-ope-squash. When running this command on any other non-squashed image, I am shown the proper image manifest.
Tried
I have tried squashing all the layers as well as squashing only a certain number of layers, both result in the same problem. I have also tried all docker versions from 24.0.0 to 24.0.7
Background
I am using the docker-squash tool to solve a problem I am having. The problem is that I need a way to customize the environment variables of an older docker image, such as UID/GID and group and then run a startup script that fixes permissions according to these new environment variables so that they may be deployed to different cloud environments that have different environment requirements. If I just run the image I want customized through the customize docker file, this results in the image I wanted customized being much larger, since we have to fix permissions on directories in order to reflect the new env variables. Which is why squashing the image is a solution to this problem since it doesn't result in an increased size. The docker image is based off of jupyter stacks minimal image. The docker file for the base image is here. The docker file for the customize stage is here. The image I am trying to squash is located here.
The Problem
After using docker-squash to squash the image, I am unable to then push this squashed image to quay.io. However, I am able to run it and test it locally and everything is working as expected. The specific error I am getting when trying to push the squashed image is
manifest invalid: manifest invalid
. After looking further into it, I believe it is because the squashed image is not having its manifest being written correctly after being squashed. I believe this because when doing adocker manifest inspect
on the image I get this outputno such manifest: quay.io/opeffort/ope-test:base-ope-image-test-custom-base-ope-squash
. When running this command on any other non-squashed image, I am shown the proper image manifest.Tried
I have tried squashing all the layers as well as squashing only a certain number of layers, both result in the same problem. I have also tried all docker versions from 24.0.0 to 24.0.7
Steps to Reproduce
make customize
in order to get squashed docker image. This runs this image through the customize dockerfile and then squashes the image.Software Versions
docker-squash: 1.1.0 docker: 24.0.7 (24.0.0 - 24.0.7) python: 3.11.6