Docker常用软件配置
开启Ipv6桥接支持
cat > /etc/docker/daemon.json <<EOF
{
"log-driver": "json-file",
"log-opts": {
"max-size": "20m",
"max-file": "3"
},
"ipv6": true,
"fixed-cidr-v6": "fd00:dead:beef:c0::/80",
"experimental":true,
"ip6tables":true
}
EOF
MySQL
docker安装MySQL
docker run --restart always -p 3306:3306 \
-v /docker/mysql:/var/lib/mysql \
--name mysql-1 --privileged=true \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql/mysql-server
设置远程登录权限:
docker exec -it mysql-1 bash
# 登录mysql
bash-4.4
mysql -uroot -p 123456
# 查看数据库
mysql> show databases;
# 进入mysql数据库
mysql> use mysql;
# 更新root用户权限为任意ip可登录
update user set host='%' where user='root' and host='localhost';
# 退出mysql
mysql> exit;
# 推出容器
bash-4.4# exit;
# 重启mysql容器,生效
[root@localhost conf]# docker restart mysql
update user set password=password("root") where user="root";
Redis
下载reids配置文件
wget https://raw.githubusercontent.com/antirez/redis/5.0/redis.conf -O redis.conf
redis配置文件修改
# bind 127.0.0.1 注掉
protected-mode yes 改成了 no
requirepass test #密码
docker 启动redis
docker run \
-p 63792:6379 --name myredis-sentinel \
-v/docker/redis1-sentinel/conf/redis.conf:/etc/redis/redis.conf \
-v /docker/redis1-sentinel/data:/data:rw \
--privileged=true -d redis redis-server /etc/redis/redis.conf \
--appendonly yes
Ubuntu
docker run --restart always -itd --name ubuntu-meng --network mynetwork --ip 172.18.0.2 ubuntu
给ubuntu22.04安装ssh
#升级安装包
apt update
#进行安装包的更新
apt upgrade
#安装ssh
apt install openssh-server
#可选项,为了连接别的ssh-server
apt install openssh-client
#安装vim
apt install vim
#将PermitRootLogin的值改为yes,/搜索即可,超级简单
vim /etc/ssh/sshd_config
#启动ssh服务
service ssh start
#修改root密码,输入passwd,然后输入修改的密码即可
passwd
#安装ufw开放22端口
apt install ufw
#开放22端口
ufw allow 22
sudo apt-get update
sudo apt-get install iproute2 //ip
sudo apt-get install net-tools //ifocnfig
sudo apt-get install inetutils-ping //ubuntu
docker network create --subnet=172.18.0.0/16 --gateway=172.18.0.1 mynetwork
docker network connect mynetwork ubuntu-meng --ip 172.18.0.2
docker network connect mynetwork frpc
portainer-ce
docker run -d -p 8000:8000 -p 9999:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data outlovecn/portainer-cn:latest
docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes cr.portainer.io/portainer/agent:2.9.3
青龙面板
docker run -dit \
-v /docker/ql/config:/ql/config \
-v /docker/ql/log:/ql/log \
-v /docker/ql/db:/ql/db \
-p 5600:5600 \
--name qinglong \
--hostname qinglong \
--restart always \
whyour/qinglong:latest
bark
docker run --restart=always -v -dt --name bark -p 8081:8080 -v /docker/bark-data:/data finab/bark-server
minimalist
docker run -d -it --restart=always --name minimalist-web-notepad -v /docker/minimalist:/var/www/html/_tmp -p 8006:80 minimalist-web-notepad
alist
docker run -d --restart=always -v /home/ikun/docker/alist:/opt/alist/data -v /hdd:/hdd -p 52441:5244 --name="alist" xhofe/alist:v2.6.4
alist3
docker run -d --restart=always -v /docker/alist3:/opt/alist/data -p 5244:5244 --name="alist3" xhofe/alist:main
docker exec -it alist ./alist admin
Cloudreve
假设当前登陆用户为 root
,则执行 id root
就会得到类似于下面的一段代码:
uid=1000(root) gid=1001(root)
mkdir -vp /docker/cloudreve/{uploads,avatar} \
&& touch /docker/cloudreve/conf.ini \
&& touch /docker/cloudreve/cloudreve.db
docker run -d \
--name=cloudreve --restart=always \
-p 5212:5212 \
--mount type=bind,source=/docker/cloudreve/conf.ini,target=/cloudreve/conf.ini \
--mount type=bind,source=/docker/cloudreve/cloudreve.db,target=/cloudreve/cloudreve.db \
-v /docker/cloudreve/uploads:/cloudreve/uploads \
-v /docker/cloudreve/avatar:/cloudreve/avatar \
cloudreve/cloudreve:latest
Memos
docker run -d --name memos --restart=always -p 5230:5230 -v /docker/memos:/var/opt/memos neosmemo/memos:latest
Excalidraw
docker-compose.yml
version: '3.3'
services:
excalidraw:
ports:
- '8099:80' # 可以更改8099端口为自己想要的端口
environment:
- TZ=Asia/Shanghai
- PUID=0
- PGID=0
volumes:
- './data:/app/web'
restart: unless-stopped
image: 'ddsderek/excalidraw'
v2rayA
docker run -d \
--restart=always \
--privileged \
--network=host \
--name v2raya \
-e V2RAYA_ADDRESS=0.0.0.0:2017 \
-v /lib/modules:/lib/modules:ro \
-v /etc/resolv.conf:/etc/resolv.conf \
-v /hdd/docker/v2raya:/etc/v2raya \
mzz2017/v2raya
aria2 pro
docker run -d \
--name aria2-pro \
--restart unless-stopped \
--log-opt max-size=1m \
--network host \
-e PUID=$UID \
-e PGID=$GID \
-e RPC_SECRET=123456 \
-e RPC_PORT=6800 \
-e LISTEN_PORT=44444 \
-v /home/ikun/docker/aria2-config:/config \
-v /home/ikun/docker/aria2-downloads:/downloads \
-e SPECIAL_MODE=rclone \
p3terx/aria2-pro
AriaNg
docker run -d \
--name ariang \
--restart unless-stopped \
--log-opt max-size=1m \
-p 6880:6880 \
p3terx/ariang
ZFile
docker run -d --name=zfile --restart=always \
-p 8081:8080 \
-v /docker/zfile/db:/root/.zfile-v4/db \
-v /docker/zfile/logs:/root/.zfile-v4/logs \
-v /docker/zfile/file:/data/file \
zhaojun1998/zfile
onlyoffice
docker run -d --name=onlyoffice -p 8002:80 --restart=always \
-v /docker/onlyoffice/data:/var/www/onlyoffice/Data onlyoffice/documentserver
Mongodb
docker run \
-d \
--name mongo \
--restart=always \
--privileged=true \
-p 27017:27017 \
-v /docker/mongodb/data:/data/db \
mongo:4.2 --auth
#进入容器
docker exec -it mongo /bin/bash
#登录mobodb
mongo admin
#创建一个名为 root,密码为 123456 的用户。
db.createUser({ user:'root',pwd:'RYykO7ANd8vKwN8PTXJvflCXoY3NqVIg',roles:[{ role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});
#尝试使用上面创建的用户信息进行连接。
db.auth('root', 'RYykO7ANd8vKwN8PTXJvflCXoY3NqVIg')
#选择admin库
use admin
#创建集合users
db.createCollection('users')
#插入数据
db.users.insert({"name":"小李","age": NumberInt(33)})
#查看数据
db.users.find()
CentOS
docker run -i -t -d --name centos7 -p 8022:22 -p 8080:80 centos:7
gitea
docker-compose.yml
version: "3"
services:
server:
image: gitea/gitea:1.17.2-rootless
container_name: gitea
restart: always
volumes:
- ./data:/var/lib/gitea
- ./config:/etc/gitea
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:80"
- "22:22"
tomcat
docker run -i -t -d --name tomcat \
-v /root/docker/tomcat/webapp:/usr/local/tomcat/webapps \
-p 8088:8080 tomcat:9.0.41-jdk8-corretto
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
cp -r webapps.dist/* webapps
webapps/manager/META-INF/context.xml
注释Value节点
showdoc
docker pull star7th/showdoc:arm-latest
docker run -d --name showdoc --user=root \
--privileged=true -p 4999:80 \
-v /docker/showdoc/html:/var/www/html/ star7th/showdoc:arm-latest
ES
docker run -d --name elasticsearch-single \
-p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" \
-e "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" \
-v /docker/es/plugins/:/usr/share/elasticsearch/plugins/ \
docker.elastic.co/elasticsearch/elasticsearch:7.17.7
Easyimage
编辑docker-compose.yml
version: '3'
services:
easyimage:
image: ddsderek/easyimage:latest
container_name: easyimage
restart: unless-stopped
ports:
- '8899:80'
environment:
- TZ=Asia/Shanghai
- PUID=1000
- PGID=1000
volumes:
- './easyimage/config:/app/web/config'
- './easyimage/i:/app/web/i'
Jenkins
docker run -u root \
-d \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
--name jenkins \
jenkinsci/blueocean
nginx-web
docker-compose.yml
version: '3'
services:
app:
image: 'chishin/nginx-proxy-manager-zh:release'
restart: always
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
palworld
wget https://www.xuehaiwu.com/wp-content/uploads/shell/Pal/PalServerInstall.sh && chmod +x PalServerInstall.sh && ./PalServerInstall.sh
本文采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 smallkun
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果