Home > other >  Docker simple mount log directory to the host machine
Docker simple mount log directory to the host machine

Time:09-17

My mirror name is webapi

Direct dockerfile generated image generated by vs

The image code is as follows:
Docker run - name=webapi - d - p 7777:80 - v/compose/webapi/logs:/logs, restart=always webapi

Question: after the operation logs directory is always not mounted to the host machine, don't know the reason why
By: check container mounted directory, and display is mounted, but the logs are only possible to see inside the container of the host machine log directory/compose/webapi/logs are empty
"Mounts" : [
{
"Type" : "bind",
"Source" : "/compose/webapi/logs",
"Destination", "/logs",
"Mode" : ", "
"RW" : true,
"Propagation" : "rprivate
"}
],
What is the reason or less what steps you
  • Related