Various embodiments are provided for automatically generating a container image by a processor. Service runtime information associated with an operating system (OS) may be detect and collected. The collected service runtime information may be validated. A container having the collected service runtime information may be created. A container image may be generated according to the container. The container image may be updated upon detecting a change to the service runtime information.