Skip to content

How to save data outside of the docker container? #3

@ovizii

Description

@ovizii

Sorry, Docker noob here. I am familiar with how to i.e. write data outside of containers if using i.e. this syntax:
docker run -d --name=test -v /my/local/path/datencockpit-db:/var/lib/mysql

but I can't figure out how this works with the docker-compose.yml.sample file. Inside there I see these relevant lines but can't figure it out on my own:

volumes:
  datencockpit-db:
  datencockpit-html:

volumes:
      - datencockpit-db:/var/lib/mysql

volumes:
      - datencockpit-html:/var/www/html

Would you mind commenting on this please? lets assume I wanted to save the Db data here /my/local/path/datencockpit-db and the HTML Data here /my/local/path/datencockpit-html so that if I update or destroy and recreate the docker container I won't lose my data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions