This Docker image is inpired by 3 other Docker images to merge all their fonctionalities in one unique image:
This Docker container provides a vsftpd server, with the following features:
- Alpine 3.9.4 base image.
- vsftpd 3.0.3
- Passive mode (disableable by env variable)
- Base the
pasv_address
on a network interface - FTPS Explicit (over ftp/ftpes protocol and port 21)
- FTPS Implicit (over ftps protocol and port 990)
- FTPS TLS (whith strong protocol/cypher)
Comming soon:
- SFTP (FTP over SSH on port 22)
- Virtual users
- Logging to STDOUT or file
- Ability to plug local folder to container volume
It's pretty simple to build the image from source thanks to the Makefile
.
$ make build
Run the container:
$ docker run --rm -it --name vsftpd -p 20-22:20-22 -p 21100-21110:21100-21110 -p 990:990 lhauspie/vsftpd-alpine
Connect to the FTP server from the host machine:
$ ftp -p localhost 21
Connect to the FTP server from another container:
$ docker run -it --rm --link vsftpd centos:7 bash
$ yum install ftp
$ ftp -p vsftpd 21
Username for the default FTP account.
If you don't specify it through the FTP_USER
environment variable at run time, user
will be used by default.
Default value: user
Accepted values: Any string. Avoid whitespaces and special chars.
This is the password of the tfp user.
Default value: pass
Accepted values: Any string. Avoid whitespaces and special chars.
Allow you to choose which ftp configuration you want to use.
Default value: ftp
Accepted values: < ftp
| ftps
| ftps_implicit
| ftps_tls
>
Allow you to enable/disable the passive mode of the FTP server.
Default value: YES
Accepted values: < NO
| YES
>
This is the address sent by the FTP server to the client during a passive mode connection. If you choose to set this variable with a hostname, just be sure that this hostname is known by the docker container.
Default value: < EMPTY STRING >.
Accepted values: Any IPv4 address or Hostname (see PASV_ADDR_RESOLVE
).
Allow you to extract the IP address of a network interface to set the PASV_ADDRESS
dynamically. Usefull when you want to connect to the FTP server from Host machine or from another container.
Default value: eth0
Accepted values: Any IPv4 address or Hostname (see PASV_ADDRESS_RESOLVE
).
PASV_ADDRESS_INTERFACE
has no effect as soon as PASV_ADDRESS
is set.
So the following command will set the pasv_address
option to the IP of the container (network interface eth0
):
$ docker run --rm -it --name vsftpd -e PASV_ADDRESS_INTERFACE=eth0 -p 21:21 -p 21100-21110:21100-21110 lhauspie/vsftpd-alpine
While the following command will set the pasv_address
to foobar
:
$ docker run --rm -it --name vsftpd -e PASV_ADDRESS=foobar -e PASV_ADDRESS_INTERFACE=eth0 -p 21:21 -p 21100-21110:21100-21110 lhauspie/vsftpd-alpine
Set to YES if you want to use a hostname (as opposed to IP address) in the PASV_ADDRESS option.
Default value: NO
Accepted values: < NO
| YES
>
To use the PASV_ADDR_RESOLVE
env variable, you have to specify the --hostname
docker run option with the same value as the env variable:
$ docker run --rm -it --hostname vsftpd --name vsftpd -e PASV_ADDRESS=vsftpd -e PASV_ADDR_RESOLVE=YES -p 21:21 -p 21100-21110:21100-21110 lhauspie/vsftpd-alpine
This will be used as the lower bound of the passive mode port range. Remember to publish your ports with docker -p
parameter.
Default value: 21100
Accepted values: Any valid port number
This will be used as the upper bound of the passive mode port range. Remember to publish your ports with docker -p
parameter.
Default value: 21110
Accepted values: Any valid port number