Allocation of access control identifiers to a container can be optimized. For example, a system can determine a largest value for a particular type of access control identifier (ACID) associated with a container image by analyzing content of the container image, the container image being for deploying a container. Next, the system can determine an amount of the particular type of ACID to allocate to the container based on the largest value. The system can then allocate the amount of the particular type of ACID to the container.