应用

gitlab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//拉取镜像
docker pull gitlab/gitlab-ce:latest

//安装
docker run \
-itd \
-p 9980:80 \
-p 9922:22 \
-v /usr/local/gitlab-test/etc:/etc/gitlab \
-v /usr/local/gitlab-test/log:/var/log/gitlab \
-v /usr/local/gitlab-test/opt:/var/opt/gitlab \
--restart always \
--privileged=true \
--name gitlab-test \
gitlab/gitlab-ce

portainer

1
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart=always --name portainer portainer/portainer-ce

netdata

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
docker pull netdata/netdata

docker run -d --name=netdata \
-p 19999:19999 \
-v netdataconfig:/etc/netdata \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata

DDNS

1
2
3
4
docker run -d --name ddns-go --restart=always -p 9876:9876 -v /opt/ddns-go:/root jeessy/ddns-go


https://github.com/jeessy2/ddns-go

操作

进入容器

1
2
3
4
5
sudo docker exec --help   

sudo docker ps

sudo docker exec -it 775c7c9ee1e1 /bin/bash

映射

1
2
3
4
5
6
7
8
9
//端口映射

-p 9980:80

//磁盘映射
-v /path/:/root/download

//:前面为本机的配置:后为容器的配置
本机:容器
1
sudo apt-get remove docker docker-engine docker.io containerd runc

sudo处理

1
sudo groupadd docker && sudo gpasswd -a jokin docker && sudo service docker restart

cloudreve云盘

1
2
3
4
5
6
7
8
9
10
11
12
13
14
docker run -d \
--name cloudreve \
-p 5212:5212 \
--restart=unless-stopped \
-v <PATH TO UPLOADS>:/cloudreve/uploads \
-v <PATH TO conf.ini>:/cloudreve/conf.ini \
-v <PATH TO cloudreve.db>:/cloudreve/cloudreve.db \
-v <PATH TO avatar>:/cloudreve/avatar \
xavierniu/cloudreve

<PATH TO UPLOADS> 为保存上传文件的路径//此处应为文件夹
<PATH TO conf.ini>:配置文件的路径//此处应为文件,可以用touch命令创建touch conf.ini
<PATH TO cloudreve.db>数据库的路径,也是文件需要用touch 创建
<PATH TO avatar>头像保存的路径

adghome

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
docker run --name adguardhome \
-v /my/own/workdir:/opt/adguardhome/work \
-v /my/own/confdir:/opt/adguardhome/conf \
-p 53:53/tcp -p 53:53/udp \
-p 80:80/tcp -p 3000:3000/tcp \
-p 67:67/udp -p 68:68/tcp -p 68:68/udp \
-p 443:443/tcp \
-p 853:853/tcp \
-d adguard/adguardhome

/my/own/workdir 为adghome工作文件夹路径
/my/own/confdir adghome配置文件夹路径
53 为dns端口
853 dns端口
80 web后台端口,可以换成别的
67 68为dhcp端口,如果不需要可以不配置删除哪一行即可
443 https端口