在安裝docker之前,我們需要先安裝一些前置組件:
yum install -y lrzsz gcc gcc-c++ make wget unzip libevent libevent-devel pcre pcre-devel zlib zlib-devel openssl openssl-devel libpng libpng-devel libjpeg libjpeg-devel libxml2 libxml2-devel libtidy libtidy-devel libxslt libxslt-devel GeoIP GeoIP-devel curl-devel libmcrypt libmcrypt-devel libcurl-devel bzip2-devel readline-devel libzip-devel git
接下來,我們需要下載和運行docker容器:
docker pull morunchang/fdfs
docker run -d --name fdfs --privileged=true --net=host --restart=always -v /etc/hosts:/etc/hosts -v /data/fdfs:/data/fastdfs morunchang/fdfs /etc/init.d/fdfs start
在docker容器中,我們需要登錄FastDFS Tracker服務器并創建一個文件存儲組:
docker exec -it fdfs /bin/bash
fdfs_trackerd /etc/fdfs/tracker.conf
# 在另一個終端中執行
docker exec -it fdfs /bin/bash
fdfs_set_group /etc/fdfs/client.conf group1
現在我們已經準備好在docker容器中使用FastDFS了!
下一篇vue流行幾年了