docker/docker-compose 安装
首先得安装docker和docker-compose,这里大家参考我之前写的文章:docker 安装 / docker-compose 安装
docker-compose.yaml
version: '2'
# Usage example: https://github.com/stilliard/docker-pure-ftpd/wiki/Docker-stack-with-Wordpress-&-FTP
services:
ftpd_server:
image: stilliard/pure-ftpd:hardened
container_name: pure-ftpd
ports:
- "21:21"
- "30000-30009:30000-30009"
volumes: # 第一行是设置ftp存储的路径,第二行是设置密码的路径
- "/data/ftp:/data/ftp"
- "/ftp/passwd:/etc/pure-ftpd/passwd"
# uncomment for ssl/tls, see https://github.com/stilliard/docker-pure-ftpd#tls
# - "/folder_on_disk/ssl:/etc/ssl/private/"
environment:
- PUBLICHOST="192.168.1.xx #这里一般设置localhost或者具体的ip
- FTP_USER_NAME=ftp #用户名
- FTP_USER_PASS=ftppwd # 密码
- FTP_USER_HOME=/data/ftp
restart: always
docker-compose 启动
docker-compose up -d
查看运行状态
docker status pure-ftpd
查看日志
$ docker logs pure-ftpd
其它具体参考 :stilliard/docker-pure-ftpd
评论区