Automatically generating a container image assembly file is provided. A definition of an application is assessed to determine a base container image and application libraries needed as add-ons for a container image corresponding to the application. A library dependency graph of flow from the base container image to add-on libraries for the application is generated. The container image assembly file is generated based on the library dependency graph of flow from the base container image to the add-on libraries for the application. Vulnerabilities corresponding to the add-on libraries of the container image assembly file are removed.