Trying to dockerise wordpress I figure out this scenenario:

2 data volume containers, one for the database (bbdd) and another for wordpress files (wordpress):

```
sudo docker create -v /var/lib/mysql --name bbdd ubuntu:trusty /bin/true
sudo docker create -v /var/www/html --name wordpress ubuntu:trusty /bin/true

```

Then I need a container for mysql so I use the [official mysql image](https://registry.hub.docker.com/_/mysql/) from docker hub and also the volume /var/lib/mysql from the first data container:

```
docker run --volumes-from bbdd --name mysql -e MYSQL_ROOT_PASSWORD="xxxx" -d mysql:5.6

```

Then I need a container for apache/php so I use [official wordpress image](https://registry.hub.docker.com/_/wordpress/) from docker hub and also the volume /var/lib/mysql from the first data container:

```
docker run --volumes-from wordpress --name apache --link mysql:mysql -d -p 8080:80 wordpress:4.1.2-apache

```

What I understand from docker docs is that if I don't remove the data containers, I'll have persistance.  

However **if I stop and delete running containers (apache and mysql) and recreate them again with last commands, data get lost**:

```
docker run --volumes-from bbdd --name mysql -e MYSQL_ROOT_PASSWORD="xxxx" -d mysql:5.6
docker run --volumes-from wordpress --name apache --link mysql:mysql -d -p 8080:80 wordpress:4.1.2-apache

```

However if I create the containers without data containers, it seems to work as I expected:

```
docker run -v /home/juanda/project/mysql:/var/lib/mysql --name mysql -e MYSQL_ROOT_PASSWORD="juanda" -d mysql:5.6
docker run -v /home/juanda/project/wordpress:/var/www/html --name apache --link mysql:mysql -d -p 8080:80 wordpress:4.1.2-apache

```