Yeah, definitely docker containers are better as they are lightweight. And docker gives you an option of pushing your image to Docker hub and whenever you want you can pull your image from there.
Also, it's your own choice to make your Docker registry as private or public. You can use Docker containers with Aws elastic beanstalk as well, which is used to automatically launch the environment and configures the AWS resources to run the code.
Sometimes it depends on the requirement of the application also. Suppose you want to run an application that require all of the operating system’s resources and functionality, then for that it's better to use Virtual machines.
I hope the above information will resolve your query.