1. 获取镜像
docker pull bjdgyc/anylink:latest
2. 查看命令信息
docker run -it --rm bjdgyc/anylink -h
3. 生成密码
docker run -it --rm bjdgyc/anylink tool -p 123456
#Passwd:$2a$10$lCWTCcGmQdE/4Kb1wabbLelu4vY/cUwBwN64xIzvXcihFgRzUvH2a
4. 生成jwt secret
docker run -it --rm bjdgyc/anylink tool -s
#Secret:9qXoIhY01jqhWIeIluGliOS4O_rhcXGGGu422uRZ1JjZxIZmh17WwzW36woEbA
5. 启动容器,拷贝配置文件到宿主机后删除容器
docker run -itd --name anylink --privileged=true bjdgyc/anylink
docker stop anylink
docker rm anylink
docker cp anylink:/app/conf /data/dockerfile/anylink/
5. 启动容器
# -e IPV4_CIDR=192.168.10.0/24 这个参数要与配置文件内的网段一致
docker run -itd --name anylink --privileged \
-e IPV4_CIDR=192.168.10.0/24
-p 443:443 -p 8800:8800 \
--restart=always \
bjdgyc/anylink
6. 使用自定义参数启动容器
# 参数可以参考 -h 命令
docker run -itd --name anylink --privileged \
-e IPV4_CIDR=192.168.0.226/24 \
-p 10443:443 -p 18800:8800 \
-v /data/dockerfile/anylink/conf:/app/conf \
--restart=always \
bjdgyc/anylink -c=/app/conf/server.toml
7. 构建镜像
#获取仓库源码
git clone https://github.com/bjdgyc/anylink.git
# 构建镜像
docker build -t anylink .
标签:anylink,run,bjdgyc,部署,--,conf,docker
From: https://www.cnblogs.com/wszzn/p/18130583