Docker FastDFS

搜索FastDFS的Docker镜像

  1. docker search fastdfs

image.png

拉取FastDFS镜像

  1. docker pull qbanxiaoli/fastdfs

启动FastDFS容器

  1. docker run -d --restart=always --privileged=true --net=host --name=fastdfs -e IP=192.168.127.131 -e WEB_PORT=80 -v ${HOME}/fastdfs:/var/local/fdfs qbanxiaoli/fastdfs

IP 后面是服务器公网ip或者虚拟机的IP,-e WEB_PORT=80 指定nginx端口

进入容器测试文件上传

  1. docker exec -it fastdfs /bin/bash
  2. echo "Hello FastDFS!">index.html
  3. fdfs_test /etc/fdfs/client.conf upload index.html

一键式安装Docker中的FastDFS脚本

  1. docker pull qbanxiaoli/fastdfs
  2. docker run -d --restart=always --privileged=true --net=host --name=fastdfs -e IP=192.168.127.131 -e WEB_PORT=80 -v ${HOME}/fastdfs:/var/local/fdfs qbanxiaoli/fastdfs