(云原生之使用docker部署filepizza文件传输工具)
一、filepizza介绍
filepizza是一款浏览器中的点对点文件传输工具。
二、检查本地系统环境
1.检查系统版本
[root@jeven ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Cor
2.检查系统内核版本
[root@jeven ~]# uname -r
6.1.8-1.el7.elrepo.x86_64
3.检查docker版本
[root@jeven ~]# docker version
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:05:12 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:03:33 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0
4.检查docker状态
[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-02-01 17:10:06 CST; 1h 40min ago
Docs: https://docs.docker.com
Main PID: 9994 (dockerd)
Tasks: 189
Memory: 375.4M
三、下载filepizza镜像
dockerhub镜像地址为:https://hub.docker.com/r/kern/filepizza
[root@jeven ~]# docker pull kern/filepizza:master
master: Pulling from kern/filepizza
c9b1b535fdd9: Pull complete
8488f113df73: Pull complete
09953e135439: Pull complete
b1863e3df3d5: Pull complete
256ec9cc264a: Pull complete
1b22108a4a0f: Pull complete
Digest: sha256:0791a0dd0583107cd481558dfab9a922cd3f480a953ceff71a9b98f0cc3b0260
Status: Downloaded newer image for kern/filepizza:master
docker.io/kern/filepizza:master
四、部署filepizza
1.创建数据目录
[root@jeven ~]# mkdor -p /data/filepizza/
[root@jeven ~]# cd /data/filepizza/
[root@jeven filepizza]#
2.创建证书
1.openssl genrsa -out server.key 2048 #生成私钥
2.openssl req -new -key server.key -out server.csr #生成证书申请文件server.csr
3.openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt #生成证书文件
3.创建filepizza容器
[root@jeven filepizza]# docker run -d --name filepizza --restart always -p 8180:8080 -e PORT=8080 -e HTTPS_KEY=/config/server.key -e HTTPS_CERT=/config/server.crt -v /data/filepizza/:/config/ kern/filepizza:master
af9b581579496af361c144260e3d553caadfd2593d70806b8b96ea25681c571c
3.查看filepizza容器状态
[root@jeven filepizza]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
af9b58157949 kern/filepizza:master "docker-entrypoint.s…" 14 seconds ago Up 13 seconds 80/tcp, 0.0.0.0:8180->8080/tcp, :::8180->8080/tcp filepizza
4.检查filepizza容器运行日志
[root@jeven filepizza]# docker logs filepizza
info: FilePizza listening on :::8080
五、访问filepizza
- https://192.168.3.166:8180/