猿创征文|云原生之Docker使用Docker部署Flare个人导航网页
Posted 江湖有缘
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了猿创征文|云原生之Docker使用Docker部署Flare个人导航网页相关的知识,希望对你有一定的参考价值。
猿创征文|【云原生之Docker】使用Docker部署Flare个人导航网页
- 一、卷首语
- 二、Flare介绍
- 三、检查本地docker环境
- 四、安装docker-compose
- 五、下载soulteary/flare镜像
- 六、使用docker命令方式安装Flare
- 七、使用docker-compose安装Flare
- 八、登录Flare的web界面
- 九、Flare的基本使用
一、卷首语
人生路漫漫其修远兮,再回首当时第一次实习的场景,历历在目。
面对陌生的IT行业,一个连操作系统都不会装的小白,一头扎进了IT技术的浩瀚深海中!
这一路走来,充满了太多的挑战和坎坷,也不断的收获与成长!
以王勃的《滕王阁序》一段,与诸君共勉!
滕王阁序
【作者】王勃
嗟乎!时运不齐,命途多舛。
冯唐易老,李广难封。
屈贾谊于长沙,非无圣主;
窜梁鸿于海曲,岂乏明时?
所赖君子见机,达人知命。
老当益壮,宁移白首之心?
穷且益坚,不坠青云之志。
酌贪泉而觉爽,处涸辙以犹欢。
北海虽赊,扶摇可接;
东隅已逝,桑榆非晚。
孟尝高洁,空余报国之情;
阮籍猖狂,岂效穷途之哭!
二、Flare介绍
1.Flare介绍
轻量、快速、美观的个人导航页面,适用于 HomeLab 或其他注重私密的场景。
2.Flare的硬件配置要求
支持 x86 以及常见的 ARM 设备,应用资源消耗非常低:
CPU: < 1%
MEM: < 30M
Docker Image: < 10M
3.Flare的特点
1.不需要数据库依赖,安装简单。
2.应用数据完全开放透明。
3.家庭及个人使用,私密性高。
三、检查本地docker环境
1.检查docker服务状态
[root@node ~]# 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 Fri 2022-08-26 00:54:36 CST; 2 days ago
Docs: https://docs.docker.com
Main PID: 11742 (dockerd)
Tasks: 38
Memory: 1.1G
CGroup: /system.slice/docker.service
├─11742 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─21262 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3876 -container-ip 172.18.0.2 -container-port 3306
├─21268 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 3876 -container-ip 172.18.0.2 -container-port 3306
├─21282 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.18.0.3 -container-port 80
└─21289 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.18.0.3 -container-port 80
Aug 26 00:54:35 node dockerd[11742]: time="2022-08-26T00:54:35.636687869+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0....IP address"
Aug 26 00:54:35 node dockerd[11742]: time="2022-08-26T00:54:35.712366254+08:00" level=info msg="Firewalld: interface docker0 already part of docker zone, returning"
Aug 26 00:54:35 node dockerd[11742]: time="2022-08-26T00:54:35.791017533+08:00" level=info msg="Loading containers: done."
Aug 26 00:54:36 node dockerd[11742]: time="2022-08-26T00:54:36.035620267+08:00" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=overlay2 version=20.10.17
Aug 26 00:54:36 node dockerd[11742]: time="2022-08-26T00:54:36.036700746+08:00" level=info msg="Daemon has completed initialization"
Aug 26 00:54:36 node systemd[1]: Started Docker Application Container Engine.
Aug 26 00:54:36 node dockerd[11742]: time="2022-08-26T00:54:36.205480897+08:00" level=info msg="API listen on /var/run/docker.sock"
Aug 26 01:33:42 node dockerd[11742]: time="2022-08-26T01:33:42.599199902+08:00" level=info msg="Firewalld: interface br-e0fbf9e9f302 already part of docker zone, returning"
Aug 26 01:33:46 node dockerd[11742]: time="2022-08-26T01:33:46+08:00" level=info msg="Firewalld: docker zone already exists, returning"
Aug 26 01:33:46 node dockerd[11742]: time="2022-08-26T01:33:46+08:00" level=info msg="Firewalld: docker zone already exists, returning"
Hint: Some lines were ellipsized, use -l to show in full.
2.检查docker配置信息
[root@node ~]# docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
compose: Docker Compose (Docker Inc., v2.6.0)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 3
Server Version: 20.10.17
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc version: v1.1.2-0-ga916309
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-957.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.62GiB
Name: node
ID: EIOB:6IAO:NQTR:AJBA:O6KS:SNWP:JEDK:GXBG:55FP:iosK:WRH3:QOAU
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://sp4mg57h.mirror.aliyuncs.com/
Live Restore Enabled: false
WARNING: IPv4 forwarding is disabled
3.开启IPv4 forwarding
[root@node ~]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
[root@node ~]# systemctl restart network
[root@node ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
四、安装docker-compose
1.下载docker-compose二进制包
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
[root@node docker-compose]# curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 423 100 423 0 0 362 0 0:00:01 0:00:01 --:--:-- 362
100 16.2M 100 16.2M 0 0 8568k 0 0:00:01 0:00:01 --:--:-- 8568k
2.给文件增加执行权限
chmod +x /usr/local/bin/docker-compose
3.检查docker-compose版本
[root@node docker-compose]# docker-compose version
docker-compose version 1.25.0, build 0a186604
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
五、下载soulteary/flare镜像
[root@node ~]# docker pull soulteary/flare
Using default tag: latest
latest: Pulling from soulteary/flare
59bf1c3509f3: Pull complete
a6c93e25cd7a: Pull complete
3cfd6fffa332: Pull complete
d476368294a8: Pull complete
Digest: sha256:4f3000dca8b8e64498f338bc7f2c32875774680d483098c3328add366846ea59
Status: Downloaded newer image for soulteary/flare:latest
docker.io/soulteary/flare:latest
六、使用docker命令方式安装Flare
1.创建Flare容器
[root@node flare]# docker run -d --name flare --restart always -p 5005:5005 -v `pwd`/app:/app soulteary/flare:latest
75b16feed071484373231668c4377dd26a5d0db442063e6b6d3811fc4ba9ea8e
2.检查容器状态
[root@node flare]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
75b16feed071 soulteary/flare:latest "flare" 25 seconds ago Up 24 seconds 0.0.0.0:5005->5005/tcp, :::5005->5005/tcp flare
3.访问web界面
七、使用docker-compose安装Flare
1.编辑docker-compose.yaml文件
[root@node flare]# cat docker-compose.yaml
version: '3.6'
services:
flare:
image: soulteary/flare
restart: always
command: flare --disable_login=0
environment:
# 如需开启用户登录模式,需要先设置 `nologin` 启动参数为 `0`
# 如开启 `nologin`,未设置 FLARE_USER,则默认用户为 `flare`
- FLARE_USER=admin
# 指定你自己的账号密码,如未设置 `FLARE_USER`,则会默认生成密码并展示在应用启动日志中
- FLARE_PASS=admin
ports:
- 5005:5005
volumes:
- ./app:/app
2.创建Flare容器
[root@node flare]# docker-compose up -d
Creating network "flare_default" with the default driver
Creating flare_flare_1 ... done
3.查看Flare容器状态
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
94b4e7f4963c soulteary/flare "flare --disable_log…" 10 seconds ago Up 8 seconds 0.0.0.0:5005->5005/tcp, :::5005->5005/tcp flare_flare_1
4.查看Flare容器日志
[root@node flare]# docker logs flare_flare_1
文件不存在
time="2022-08-28T16:19:17+08:00" level=info msg="Flare v0.3.3-FE6D1F4 linux/amd64 BuildDate=2022-03-10T15:40:35+0800\\n"
time="2022-08-28T16:19:17+08:00" level=info
time="2022-08-28T16:19:17+08:00" level=info msg="程序服务端口 5005"
time="2022-08-28T16:19:17+08:00" level=info msg="页面请求合并 false"
time="2022-08-28T16:19:17+08:00" level=info msg="启用离线模式 false"
time="2022-08-28T16:19:17+08:00" level=info msg="启用登陆模式,调整应用设置需要先进行登陆。"
time="2022-08-28T16:19:17+08:00" level=info msg="当前内容整体可见性为: DEFAULT"
time="2022-08-28T16:19:17+08:00" level=info msg="应用用户设置为 admin"
time="2022-08-28T16:19:17+08:00" level=info msg="应用登陆密码已设置为 a***n"
time="2022-08-28T16:19:17+08:00" level=info msg="在线编辑模块启用,可以访问 /editor 来获取程序使用帮助。"
time="2022-08-28T16:19:17+08:00" level=info msg="向导模块启用,可以访问 /guide 来获取程序使用帮助。"
time="2022-08-28T16:19:17+08:00" level=info msg="程序已启动完毕 🚀"
八、登录Flare的web界面
九、Flare的基本使用
1.访问帮助页面
2.主题设置
3.打开Flare在线编辑网址链接
4.添加个人音乐网站到Flare
5.选择图标挑选功能
6.搜索网站图标
搜索到自己喜欢的图标后,复制图标名称
7.将图标名称复制到Flare 在线数据编辑中
8.查看Flare展示效果
9.通过Flare网址导航跳转到个人网页
以上是关于猿创征文|云原生之Docker使用Docker部署Flare个人导航网页的主要内容,如果未能解决你的问题,请参考以下文章
猿创征文|云原生 | 24Docker运行数据库实战之MongoDB
猿创征文 | 国产数据库实战使用docker部署PolarDB-X云原生分布式开源数据库
猿创征文|云原生 | 27Docker部署运行开源消息队列实现RabbitMQ
猿创征文|云原生 | 25Docker运行数据库实战之Redis