Docker 再学习 (11) Docker Volume

Submitted by Lizhe on Mon, 03/11/2019 - 03:38

 

 

lizhedeMacBook-Pro:study lizhe$ cat docker-compose.yaml 

version: "3.2"

services:

  nginxservice:

    image: nginxdemos/hello

    ports:

      - "80:80"

    volumes:

      - type: volume

        source: mydata

        target: /tmp

      - type: bind

        source: ./nginx/logs

        target: /var/log/nginx

volumes:

  mydata:

lizhedeMacBook-Pro:study lizhe$

 

20190311113534