[Solved] Cannot mount host directory with mattermost Docker container

I’m using the mattermost container 2.0 (https://github.com/mattermost/platform/tree/master/docker/2.0), and I’m trying to mount the /mattermost/data volume to the host directory - but files created in the container are not visible in the host. Here is the result of docker inspect mattermost:

{
    "Source": "/mnt/mattermost-data/data",
    "Destination": "/mattermost/data",
    "Mode": "",
    "RW": true
},
{
    "Source": "/mnt/mattermost-data/db",
    "Destination": "/var/lib/mysql",
    "Mode": "",
    "RW": true
}

I’ve tried to set the permission to 777 to the folders, but still no luck.
What do I need to do to persist on the host the data, db, and config folders?

A couple of thoughts:

  1. Per the product documentation, the Preview Mode Docker image is not designed for production for several reasons. There is a production setup offered by the Mattermost Community you might consider.

  2. The issue you’re having appears to be Docker-specific and not related to Mattermost. Please consider posting to Docker Community Forum.

Yes it is indeed a problem related to docker + EBS on AWS. I don’t know why, but if I mount the EBS disk after that docker is started, data will not be writtend on the mountpoint volume. Instead, restarting docker after mounting the EBS volume, gets everything working…
just sharing here in case someone finds the same issue!