Patent attributes
Co-locating containers based on source to improve compute density is disclosed. For example, a repository stores image files associated with metadata. A scheduler receives a request to launch a container using an image file having a source. The container is launched in a host with a first version of first and second container components loaded to a host memory. A request to launch another container using another image file having the source is received. This container includes the first version of first and third container components, and is launched in the host. The first version of the third container component is loaded to the host memory. A request to launch a third container using a third image file having a different source is received, and is launched in the second host, including a second version of the first, second and third container components, all loaded to a second host memory.