To install packages in a docker container, the packages should be defined in the Dockerfile.
If you want to install packages in the Container, use the RUN statement followed by exact download command .
$ RUN pip install <package name > //IN Windows
$ RUN apt-get install <package name > //in Ubuntu
$ RUN yum install <package name> //CentOS/RHEL
You can update the Dockerfile with latest list of packages at anytime and build again to create new image out of it.
Hope this will help.