Ubuntu uses Docker image to build FastDFS

prologue

​ According to reason, follow the official steps to install FastDFS, originally just a few commands, it should be very smooth.

  1. Compiler Environment
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
  1. installationlibfatscommon
git clone https://github.com/happyfish100/libfastcommon.git --depth 1
cd libfastcommon/
./make.sh && ./make.sh install #编译安装
  1. installationFastDFS
cd ../ #返回上一级目录
git clone https://github.com/happyfish100/fastdfs.git --depth 1
cd fastdfs/
./make.sh && ./make.sh install #编译安装

​ By the way, the Linux distribution of this server is Ubuntu, the official one CentOS 7.x, well, I have to do it myself.

​ Fortunately, I Dockerfound that some big guys have already FastDFSpackaged it into a mirror image and uploaded it. Then it will be easier to set up. Of course, the premise is still Dockerbetter.

If you don't need Dockerit, you can install various compilation environments yourself. Although it is a bit more troublesome, it will be more flexible and convenient to configure. This method can refer to the following article, I am lazy, so I used it directly Docker.

[1] Install FastDFS on Ubuntu

[2] Installation of FastDFS under Ubuntu

[3] fastDFS

Install FastDFS

1. The first step is to install docker

#安装docker
yum install -y docker-io
#启动docker
service docker star 
# 查看docker版本
docker -v  

2. Pull the image

#拉取镜像
docker pull qbanxiaoli/fastdfs

This step will take a long time, because it takes a certain amount of time to pull the image and load it, and it is related to the configuration and environment of the machine.

Insert picture description here

3. Start fastdfs

#启动镜像
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 : Behind is your server's public network ip or virtual machine ip

  • -e WEB_PORT=80 : Specify the nginx port

4. Test whether fastdfs is successfully built

docker exec -it fastdfs /bin/bash

echo "Hello FastDFS!">index.html

fdfs_test /etc/fdfs/client.conf upload index.html

Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43438052/article/details/114279676