delfer / docker-alpine-ftp-server

Small and flexible docker image with vsftpd server
186 stars 131 forks source link

How do I map a volume on the Docker host? #35

Closed danijeljw-RPC closed 2 years ago

danijeljw-RPC commented 2 years ago

I looked through the .conf file and cannot see where there or the docker ENV supports mapping a volume on the server to the container as a mount point?

How do I specify the root mount point for users?

delfer commented 2 years ago

@danijeljw-RPC it can be done using Docker's command line arguments, exactly -v as in docs https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only

For example

docker run -d \
    -p 21:21 \
    -p 21000-21010:21000-21010 \
    -e USERS="one|1234|/folder/in/container" \
    -e ADDRESS=ftp.site.domain \
    -v /folder/on/server:/folder/in/container
    delfer/alpine-ftp-server

Here is /folder/on/server will be mapped to /folder/in/container and user one will see this folder after connection.

delfer commented 2 years ago

Not an issue