cancel
Showing results for 
Search instead for 
Did you mean: 
Ravi_Shanker
Flight Engineer
Flight Engineer
  • 1,469 Views

Creating image using podman with ONBUILD in Containerfile

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

Certification ID: 111-010-393
Labels (4)
3 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,444 Views

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. 

Chetan_Tiwary__0-1697454477494.png

https://github.com/containers/buildah/issues/2317 

florinman
Mission Specialist
Mission Specialist
  • 1,301 Views

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.

0 Kudos
Vinod_Narayan
Mission Specialist
Mission Specialist
  • 886 Views

(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

0 Kudos
Join the discussion
You must log in to join this conversation.