搭建一个轻量级的ftp服务器

Terwer 经验分享评论21字数 890阅读2分58秒阅读模式

搭建

直接使用我写好的 docker-compose​ 脚本即可。文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

Dockerfile文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

# 依赖的镜像
FROM delfer/alpine-ftp-server:latest

#镜像创建者的信息
MAINTAINER terwer "youweics@163.com"

# 设置编码
ENV LANG C.UTF-8

# 设置时区
ENV TZ Asia/Shanghai

# docker inspect portable-ftpserver | grep IPAddres

docker-compose.yml文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

# docker-compose --log-level INFO up --build portable-mina-ftpserver
# docker-compose --log-level INFO up

version: '3'
services:
  portable-redis7:
    image: terwer/ftpserver:latest
    container_name: portable-ftpserver
    build:
     context: .
     dockerfile: Dockerfile
    ports:
     - "21:21"
     - "21000-21010:21000-21010"
    environment:
     - "TZ=Asia/Shanghai"
     - "USERS=terwer|123456|/Users/terwer/ftppath|10000"
     - "ADDRESS=localhost"
    volumes:
      - ./ftphome:/Users/terwer/ftppath
    stdin_open: true
    restart: "no"
    networks:
      - local-dev

networks:
  local-dev:
    external: true

运行 ftpserver

docker-compose.yml​ 的同级目录,新建一个 ftphome​ 文件夹,然后运行下面命令即可。文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

docker compose up --build

连接 ftp 测试

使用 Filezilla文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

搭建一个轻量级的ftp服务器文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

信息如下:文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

Host localhost
Port 21 # 端口默认是21,可以不写

User terwer
Password 123456

效果:文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

搭建一个轻量级的ftp服务器文章源自浅海拾贝-https://blog.terwergreen.com/build-a-lightweight-ftp-server-z1ch9hr.html

相关文章
  • 扫码加我微信
  • 验证消息请输入:来自你的博客
  • weinxin
  • 我的微信公众号
  • 微信扫一扫与我交流吧
  • weinxin
Terwer
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: