使用Docker构建rancher ui镜像必须准备好
- 要部署的服务器ip或域名
- 部署的端口
- https证书
以部署到 192.168.99.100:8000 为例
复制代码
1
2
3
4
5
6
7
8./scripts/build-static -l -s -v 'rancher-ui' -c '192.168.99.100:8000' # 编译前端项目 docker build -t rancher-ui:latest . # 构建镜像 docker stop ou && docker container rm ou # 停止旧容器并移除 docker run -d -p 8000:8000 --name ou rancher-ui:latest # 运行新的rancher-ui镜像
Dockerfile
复制代码
1
2
3
4
5
6
7FROM nginx:latest COPY ssl /rancher-ui/ssl COPY rancher-ui.conf /etc/nginx/conf.d COPY /dist/static /rancher-ui/www
rancher-ui.conf文件
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19server { listen 8000 ssl; server_name 127.0.0.1; ssl_certificate /rancher-ui/ssl/server.crt; ssl_certificate_key /rancher-ui/ssl/server.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; add_header Access-Control-Allow-Origin *; location / { alias /rancher-ui/www/; index index.html index.htm; } }
run之后 访问链接https://192.168.99.100:8000/rancher-ui/
看到
出现此页面表明一切正常。
后在rancher中访问 /v3/settings/ui-index 如 我的rancher部署在192.168.59.129
https://192.168.59.129/v3/settings/ui-index
需登录后访问
将https://192.168.99.100:8000/rancher-ui/ 填充value中,并保存上传。 在重新刷新rancher的页面,就是新的自定义UI页面。
最后
以上就是笨笨萝莉最近收集整理的关于构建rancher自定义ui的前端镜像的全部内容,更多相关构建rancher自定义ui内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复