

Forked from fauria/vsftpd
This Docker container implements a vsftpd server, with the following features:
You can download the image with the following command:
docker pull apkawa/vsftpd
This image uses environment variables to allow the configuration of some parameters at run time:
FTP_USERSFTP_USER environment variable at run time, admin will be used by default.FTP_PASV_ADDRESS_ENABLEFTP_PASV_ADDRESS_RESOLVEPASV_ADDRESS option.FTP_PASV_ADDRESSFTP_PASV_ADDRESS_RESOLVE).FTP_PASV_ADDR_RESOLVEFTP_PASV_ENABLEFTP_PASV_MIN_PORTdocker -p parameter.FTP_PASV_MAX_PORTFTP_XFERLOG_STD_FORMATFTP_LOG_STDOUTFTP_FILE_OPEN_MODEFTP_LOCAL_UMASKMore variables with prefix FTP_ pass to vsftpd.conf
As example, in documentation banner_file=path_to_file, variable must be FTP_BANNER_FILE=/path/to/file
http://vsftpd.beasts.org/vsftpd_conf.html
The image exposes ports 20 and 21. Also, exports two volumes: /home/vsftpd, which contains users home directories, and /var/log/vsftpd, used to store logs.
When sharing a homes directory between the host and the container (/home/vsftpd) the owner user id and group id should be 14 and 80 respectively. This corresponds to ftp user and ftp group on the container, but may match something else on the host.
Create a temporary container for testing purposes:
docker run --rm apkawa/vsftpd
Create a container in active mode using the default user account, with a binded data directory:
docker run -d -p 21:21 -v /my/data/directory:/home/vsftpd --name vsftpd apkawa/vsftpd
# see logs for credentials:
docker logs vsftpd
Create a production container with a custom user account, binding a data directory and enabling both active and passive mode:
docker run -d -v /my/data/directory:/home/vsftpd \
-p 20:20 -p 21:21 -p 21100-21110:21100-21110 \
-e FTP_USERS=myuser:mypass \
-e FTP_PASV_ADDRESS=127.0.0.1 -e FTP_PASV_MIN_PORT=21100 -e FTP_PASV_MAX_PORT=21110 \
--name vsftpd --restart=always apkawa/vsftpd
Manually add a new FTP user to an existing container:
docker exec -i -t vsftpd run-vsftpd.sh add_user myuser mypass
Enable SSL and auto generate self signed certificate
docker run -d -v /my/data/directory:/home/vsftpd \
-p 20:20 -p 21:21 -p 21100-21110:21100-21110 \
-e FTP_USERS=myuser:mypass \
-e FTP_CERTIFICATE_GENERATE='YES'
-e FTP_CERTIFICATE_EXPIRE=365
-e FTP_SSL_ENABLE='YES'
-e FTP_CERTIFICATE_SUBJ="/C=US/ST=Warwickshire/L=Leamington/O=apkawa/OU=vsftpd/CN=localhost"
--name vsftpd_ssl --restart=always
apkawa/vsftpd
Certificate regenerated after change FTP_CERTIFICATE_SUBJ or end of expire
Enable SSL and use existed certificate. as example - use letsencrypt certificate
docker run -d
-v /my/data/directory:/home/vsftpd \
-v /my/path/to/letsencrypt/example.com/:/etc/certs/:ro
-p 20:20 -p 21:21 -p 21100-21110:21100-21110 \
-e FTP_USERS=myuser:mypass \
-e FTP_SSL_ENABLE='YES'
-e FTP_RSA_CERT_FILE="/etc/certs/fullchain.crt"
-e FTP_RSA_PRIVATE_KEY_FILE="/etc/certs/key.pem"
--name vsftpd_ssl --restart=always
apkawa/vsftpd
Content type
Image
Digest
Size
79.2 MB
Last updated
almost 7 years ago
docker pull apkawa/vsftpd