搜索docker镜像,使用命令docker search fastdfs
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/season/fastdfs FastDFS 40
docker.io docker.io/luhuiguo/fastdfs FastDFS is an open source high performance... 18 [OK]
docker.io docker.io/morunchang/fastdfs A FastDFS image 10
docker.io docker.io/ygqygq2/fastdfs-nginx 整合了nginx的fastdfs 6 [OK]
docker.io docker.io/lionheart/fastdfs-tracker just have a try on autobuilded -_-# 3 [OK]
docker.io docker.io/imlzw/fastdfs-tracker fastdfs的tracker服务 2 [OK]
docker.io docker.io/qbanxiaoli/fastdfs FastDFS单机版 2 [OK]
docker.io docker.io/appcrash/fastdfs_nginx fastdfs with nginx 1
docker.io docker.io/delron/fastdfs 1
docker.io docker.io/ecarpo/fastdfs-storage 1
docker.io docker.io/evan1120/fastdfs_storage The fastdfs storage image 1 [OK]
docker.io docker.io/evan1120/fastdfs_tracker The fastdfs tracker docker image, only con... 1 [OK]
docker.io docker.io/imlzw/fastdfs-storage-dht fastdfs的storage服务,并且集成了fastdht的服务,实现文件排重 1 [OK]
docker.io docker.io/john123951/fastdfs_storage fastdfs storage 1 [OK]
docker.io docker.io/lionheart/fastdfs-storage 更加规范的Dockerfile,能够自动构建了。 1 [OK]
docker.io docker.io/lionheart/fastdfs_storage the fastdfs file system's storage node 1
docker.io docker.io/lionheart/fastdfs_tracker fastdfs file system‘s tracker node 1
docker.io docker.io/manuku/fastdfs-tracker fastdfs tracker 1 [OK]
docker.io docker.io/ecarpo/fastdfs 0
docker.io docker.io/john123951/fastdfs_tracker fastdfs tracker 0 [OK]
docker.io docker.io/manuku/fastdfs-fastdht fastdfs fastdht 0 [OK]
docker.io docker.io/manuku/fastdfs-storage-dht fastdfs storage dht 0 [OK]
docker.io docker.io/manuku/fastdfs-storage-proxy fastdfs storage proxy 0 [OK]
docker.io docker.io/mypjb/fastdfs this is a fastdfs docker project 0 [OK]
docker.io docker.io/tsl0922/fastdfs FastDFS is an open source high performance... 0 [OK]
拉取需要的镜像,docker image pull delron/fastdfs,该镜像中包含Nginx
使用docker镜像构建tracker容器
docker run -dti --network=host --name tracker -v /var/fdfs/tracker:/var/fdfs -v /etc/localtime:/etc/localtime delron/fastdfs tracker
使用docker镜像构建storage容器(存储服务器,提供容量和备份服务)
docker run -dti --network=host --name storage -e TRACKER_SERVER=192.168.1.13:22122 -v /var/fdfs/storage:/var/fdfs -v /etc/localtime:/etc/localtime delron/fastdfs storage
TRACKER_SERVER=物理机ip:22122
然后我们图片服务器成功搭建,但是有时我们需要修改storage配置文件和Nginx监听端口,我们继续向下配置:
进入storage容器,到storage的配置文件中配置http访问的端口,
[root@localhost ~]# docker exec -it storage bash
[root@localhost nginx-1.12.2]# vi /etc/fdfs/storage.conf
# tracker_server can ocur more than once, and tracker_server format is
# "host:port", host can be hostname or ip address
tracker_server=192.168.1.13:22122 -->修改成自己物理机ip
翻到最后
http.server_port=8888
修改成自己配置的http访问的端口
Nginx监听端口修稿:
[root@localhost ~]# docker exec -it storage bash
[root@localhost nginx-1.12.2]# vi conf/nginx.conf
或者
[root@localhost nginx-1.12.2]# vi /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
到目前所有配置均完成
重启storage
[root@localhost nginx-1.12.2]# exit
exit
[root@localhost ~]# docker restart storage
storage
出现如下图表示我们配置已成功
docker 上传文件可参照其他博客,此处不再累赘
访问成功如下: