The docker volume create reference implies that you can docker volume create --driver local
and create a Docker volume that is a specific mounted filesystem. There’s even a specific example for NFS there.
I haven’t tested this specifically, but I think it should look roughly like the following:
version: '2'
volumes:
nfs:
driver: local
driver_opts:
type: nfs
o: addr=192.168.1.1,rw
device: ":/path/to/dir"
services:
php-fpm:
volumes:
- nfs:/path/in/container
...
I’m pretty sure starting a container just to provide a volume isn’t considered a best practice any more (I do see it mentioned as an example in the documentation, though).
Given that your previous step build:
a container from source, I’d definitely include your application in the container and not try to “inject” it into the container like this.
Are you looking for the standard mysql
image?