https://rol.redhat.com/rol/app/courses/do288-4.10/pages/ch02s03 Notes mentions for ONBUILD in container file podman option "--format docker" should be used. However in the guided exercise https://rol.redhat.com/rol/app/courses/do288-4.10/pages/ch02s04 the option "--layers=false" is used and not "--format docker". Can someone explain why "--layers=false" option is used and not "--format docker" for podman build command in the guided exercise?
What is the usecase for using the option "--layers=false" in podman build command.
Thanks in Advance.
Ravi Shanker
Hello @Ravi_Shanker !
I think this one is not there in the latest v4.12 course.
However, wrt your question - I understand that yours is a valid enquiry. It seems that the guided exercise works without --format docker option as well. I have raised this issue to the curriculum development team for an explanation.
--layers=false is used to build a single layer monilithic image which is simple and efficient. Hence it is used here. Whwreas --format docker is used when you want to specify the image fomat as docker format while building a multi layer image. And also it supports the onbuild instruction.
It might be that you are mistaken layers=false for --squash. The first option is only preventing caching the layers during the build. You could build an image with the first option and then inspect it to see that it still has multiple layers.
(1) For multistage build (Containerfile), we should use deployment or deploymentConfig. What is the best practice?
(2) While deploying the new-app , what is the recommended way for external link use , direct or through image-stream
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.