一、安装
1、创建文件夹
mkdir /usr/local/pritunl/{mongo,pritunl} -p
2、进入目录
cd /usr/local/pritunl/
3、授权
chown -R daemon.daemon mongo/
chown -R daemon.daemon pritunl/
4、编辑docker-compose.yml文件
vim docker-compose.yml
输入下面内容
version: '3'
services:
network:
image: busybox
ports:
- "8024:8024/udp"
- "8024:8024/tcp"
- "7080:80/tcp"
- "7443:443/tcp"
restart: always
tty: true
pritunl:
image: jippi/pritunl:latest
privileged: true
restart: always
volumes:
- /usr/local/pritunl/pritunl:/var/lib/pritunl
- /usr/local/pritunl/mongo:/var/lib/mongodb
network: container:network
network:
image: busybox
ports:
- "8024:8024/udp" # vpn的udp端口
- "8024:8024/tcp" # vpn的tcp端口
- "7080:80/tcp" # pritunl http端口,这里随便也可以直接用80,我是为了防止和k8s集群的nginx-ingress的端口冲突,所以就修改了
- "7443:443/tcp" # pritunl https端口
restart: always
tty: true
pritunl:
image: jippi/pritunl:latest
privileged: true
restart: always
volumes:
- /usr/local/pritunl/pritunl:/var/lib/pritunl
- /usr/local/pritunl/mongo:/var/lib/mongodb
net: container:network
5、启动
docker-compose up -d
6、查看状态
docker ps
二、登录
1、获取密码
docker exec -it pritunl_pritunl_1 sh
pritunl default-password
2、浏览器访问
建议使用https访问