(云原生之使用Docker部署Dailynotes个人笔记管理工具)
一、Dailynotes介绍
DailyNotes 用于每天记笔记和跟踪任务的应用程序。本工具使用markdown进行编辑,也可以作为个人任务看板 。
二、检查本地docker环境
1.检查docker版本
[root@jeven ~]# docker -v
Docker version 20.10.21, build baeda1f
2.检查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 Tue 2022-12-13 23:18:38 CST; 3 days ago
Docs: https://docs.docker.com
Main PID: 123665 (dockerd)
Tasks: 35
Memory: 866.1M
CGroup: /system.slice/docker.service
├─ 85553 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8280 -container-ip 172.29.0.3 -container-port 8...
├─ 85559 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8280 -container-ip 172.29.0.3 -container-port 80
└─123665 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Dec 15 16:35:27 jeven dockerd[123665]: time="2022-12-15T16:35:27.474933141+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:42:28 jeven dockerd[123665]: time="2022-12-15T16:42:28.807181868+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:42:30 jeven dockerd[123665]: time="2022-12-15T16:42:30.833205034+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:44:45 jeven dockerd[123665]: time="2022-12-15T16:44:45.717596691+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:44:47 jeven dockerd[123665]: time="2022-12-15T16:44:47.614184252+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:51:19 jeven dockerd[123665]: time="2022-12-15T16:51:19.883426125+08:00" level=info msg="Attempting next endpoin...nknown"
Dec 15 16:53:10 jeven dockerd[123665]: time="2022-12-15T16:53:10.962851020+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:54:23 jeven dockerd[123665]: time="2022-12-15T16:54:23.945325875+08:00" level=info msg="Container failed to exi...69690ad
Dec 15 16:54:23 jeven dockerd[123665]: time="2022-12-15T16:54:23.988627019+08:00" level=info msg="ignoring event" contain...Delete"
Dec 15 16:54:25 jeven dockerd[123665]: time="2022-12-15T16:54:25.583076270+08:00" level=info msg="ignoring event" contain...Delete"
Hint: Some lines were ellipsized, use -l to show in full.
三、下载Dailynotes镜像
[root@jeven ~]# docker pull m0ngr31/dailynotes
Using default tag: latest
latest: Pulling from m0ngr31/dailynotes
a0d0a0d46f8b: Pull complete
c11246b421be: Pull complete
5e6f9a3065f1: Pull complete
1d7a167f2660: Pull complete
0e99e6f9c94e: Pull complete
023f5e971f19: Pull complete
65443aed7a95: Pull complete
638406412343: Pull complete
4b8b1c924a17: Pull complete
fb955ab9429e: Pull complete
faa985ac7361: Pull complete
7aa82505b1f9: Pull complete
5179a963d3c8: Pull complete
bfe397d7a606: Pull complete
4f4fb700ef54: Pull complete
f2b30d7853fe: Pull complete
8bec921dc040: Pull complete
2c852d04a890: Pull complete
6b1778ab4cf3: Pull complete
3568c7e13669: Pull complete
Digest: sha256:67c47631ff74dc41fd2effbf001543476af77a457912a17961d4bd790e93c3cd
Status: Downloaded newer image for m0ngr31/dailynotes:latest
docker.io/m0ngr31/dailynotes:latest
四、创建Dailynotes容器
1.创建数据目录
- 创建挂载目录
[root@jeven ~]# mkdir -p /data/dailynotes/config_dir
[root@jeven ~]# cd /data/dailynotes/
[root@jeven dailynotes]#
- 设置挂载目录权限
chmod -R 777 /data/dailynotes/
备注:也可以在运行容器时,docker run -d -u 0(用户ID或用户名),如果不设置权限,会出现登录账号无法注册情况,特此说明,
2.创建Dailynotes容器
docker run -d --name mynotes -p 5000:5000 -v /data/dailynotes/config_dir:/app/config m0ngr31/dailynotes
3.查看Dailynotes容器状态
[root@jeven dailynotes]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a28dd20fb890 m0ngr31/dailynotes "/bin/sh -c \"./run.s…" 39 seconds ago Up 38 seconds 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp mynotes