How to synchronize the docker container with the system time


 description

Start the mongo container and synchronize the system time

 command

docker run -d --name test -v /etc/localtime:/etc/localtime:ro  mongo

 parameter

run : Run a command in a new container
--name : Assign a name to the container
-d :   Run container in background and print container ID
-v :  Bind mount a volume

 result

2d5e865e451456d64647711c60521bfdcf6c...

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.