3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dockerで自己証明書付きFTPSサーバを起動する

Posted at

Dockerで自己証明書付きFTPSサーバを起動するメモ

Dockerfileの記述

FROM stilliard/pure-ftpd

RUN mkdir -p /etc/ssl/private && \
  openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 && \
  openssl req -subj '/CN=ftps.local/O=DOCKER/C=JP' -x509 -nodes -newkey rsa:2048 -sha256 -keyout \
    /etc/ssl/private/pure-ftpd.pem \
    -out /etc/ssl/private/pure-ftpd.pem && \
  chmod 600 /etc/ssl/private/*.pem

CMD /run.sh -c 5 -C 5 -l puredb:/etc/pure-ftpd/pureftpd.pdb -E -j -R -P $PUBLICHOST -p 30000:30009 -s -A -j -Z -H -4 -E -R -G -X -x

ビルド

docker build -t=ftpd .

起動

docker run -d --name ftpd \
	-p 21:21 \
	-p 30000-30009:30000-30009 \
	-e "PUBLICHOST=localhost" \
    -e "ADDED_FLAGS=--tls=2" \
	ftpd

ユーザ追加

docker exec -it ftpd /bin/bash
pure-pw useradd {user_name} -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /home/ftpusers/{user_name}
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?