Containers are a way to replicate code execution environments consistently. This used to be done with virtual machines. But containers are a more compact and lightweight of doing this by sanboxing execution within the host. Virtual machines load entire operating systems within the operating system hosting it through a hypervisor. Containers merely share sandboxed resources of the host and only add the differences needed for that container from the host.
This is detailed in Database Containerization