Sign inSign up

infrascielo/pureftp

By infrascielo

•Updated about 10 years ago

Pure-FTPd docker

Image
1

747

infrascielo/pureftp repository overview

⁠Docker Pure-FTPd

Docker image for Pure-FTPd⁠. This README is based on bamarni⁠. Included the instruction to create docker.

⁠Basic usage

With a single user :

docker run -d \
    -e PUREFTP_PASSIVE_IP=XXX.X.XX.X\
    -p 21:21 -p 40000-40009:40000-40009\
    -e PUREFTP_USER=user -e PUREFTP_PASSWORD=pass\
    infrascielo/pureftp

PUREFTP_PASSIVE_IP has to be the IP address of the machine running the container, it can also be its domain name.

⁠Expose existing directory from the host

If you want to expose an existing directory from your machine, you can use a volume. This instruction keep all data in save (user data and database) :

docker run -d \
    -e PUREFTP_PASSIVE_IP=XXX.X.XX.X\
    -p 21:21 -p 40000-40009:40000-40009\
    -v /path/host/data:/etc/pureftpd\
    -v /path/in/host:/home/ftpuser -e PUREFTP_USER=user -e PUREFTP_PASSWORD=pass\
    infrascielo/pureftp

⁠Creating new users

It's necessary the container being executing:

docker exec -ti <container id or name> bash
mkdir /home/ftpuser/<PUREFTP_USER>
chown ftpuser:ftpgroup /home/ftpuser/<PUREFTP_USER>
pure-pw useradd <PUREFTP_USER> -u ftpuser -d /home/ftpuser/<PUREFTP_USER> -f /etc/pureftpd/pureftpd.passwd
pure-pw mkdb /etc/pureftpd/pureftpd.pdb -f /etc/pureftpd/pureftpd.passwd

⁠FTP over TLS

To allow FTP over TLS, you can provide a certificate.

⁠1) Self-signed certificate

The first solution is to create a self-signed certificate, you can provide the certificate subject like this :

docker run -d \
    -e PUREFTP_PASSIVE_IP=example.org\
    -p 21:21 -p 40000-40009:40000-40009\
    -e PUREFTP_CERT_SUBJ="/C=FR/O=My company/CN=example.org"\
    -e PUREFTP_USER=user PUREFTP_USER=user -e PUREFTP_PASSWORD=pass\
    infrascielo/pureftp
⁠2) Mounting a certificate from the host

You can instead mount a certificate from the host :

docker run -d \
    -e PUREFTP_PASSIVE_IP=example.org\
    -p 21:21 -p 40000-40009:40000-40009\
    -v /path/to/host/certificate:/etc/ssl/private/pure-ftpd.pem\
    -e PUREFTP_USER=user PUREFTP_USER=user -e PUREFTP_PASSWORD=pass\
    infrascielo/pureftp

Tag summary

Content type

Image

Digest

Size

135.3 MB

Last updated

about 10 years ago

docker pull infrascielo/pureftp