version: '3' services: ubuntu: image: ubuntu container_name: ubuntu01 tty: true volumes: - ".:/var/log"
Explain the meaning based on the sample
version: '3' # docker-The version of compose. I rarely use anything other than 3 services: #Name the combination name of the container myweb: #Name the combination name myweb. You can choose the name you like image: centos #Specify the image of the container. When specifying the version`centos:7`Described as. If no version is specified, the latest version is automatically specified. container_name: my-centos #Specify the name of the container to be created. You can choose the name you like. It is easier to understand later if you specify it. tty: true #Specify that Bash is in the input waiting state (It is not necessary to specify it in the system that opens the port and listens like nginx and mysql) volumes: #Specify the path to synchronize. - ".:/var/log" #Host path:Describe the path to be synchronized in the form of container path. The above is the host's current directory and container/var/log directory is connected