Kubernates上Docker怎么安装自定义镜像
发表于:2024-10-22 作者:千家信息网编辑
千家信息网最后更新 2024年10月22日,本篇内容主要讲解"Kubernates上Docker怎么安装自定义镜像",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Kubernates上Docker怎么
千家信息网最后更新 2024年10月22日Kubernates上Docker怎么安装自定义镜像
本篇内容主要讲解"Kubernates上Docker怎么安装自定义镜像",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Kubernates上Docker怎么安装自定义镜像"吧!
1.创建springboot应用,比如helloworld,并打包为jar文件
2.创建Dockerfile镜像构建文件
FROM frolvlad/alpine-oraclejdk8:slimMAINTAINER "xxx"LABEL description="Spring Boot Image As Helloworld"WORKDIR /appVOLUME /tmpENV LANG en_US.UTF-8RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeCMD locale && dateCOPY helloworld-0.0.1-SNAPSHOT.jar helloworld.jarRUN sh -c 'touch /helloworld.jar'ENV JAVA_OPTS=""EXPOSE 8080ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -jar helloworld.jar" ]
3.上传Dockerfile文件和jar包到服务器同一文件夹下
4.执行构建语句
docker build -t springboot-helloworld:latest .
5.打标签,并push到本地镜像中
docker tag springboot-helloworld 192.168.1.2:5000/springboot-helloworld:latest
6.创建资源springboot-helloworld-rc.yaml文件
apiVersion: v1kind: ReplicationControllermetadata: name: springboot-helloworld labels: name: springboot-helloworldspec: replicas: 3 selector: name: springboot-helloworld template: metadata: labels: name: springboot-helloworld spec: containers: - name: springboot-helloworld image: 192.168.1.2:5000/springboot-helloworld:latest ports: - containerPort: 8080
7.创建服务springboot-helloworld-svc.yaml文件
apiVersion: v1kind: Servicemetadata: name: springboot-helloworld labels: name: springboot-helloworldspec: type: NodePort ports: - port: 8080 nodePort: 28080 selector: name: springboot-helloworld
8.通过Kubernates容器web ui界面进行创建资源-rc
9.通过Kubernates容器web ui界面进行创建服务-svc
10.访问helloworld服务
http://192.168.1.0:28080
到此,相信大家对"Kubernates上Docker怎么安装自定义镜像"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
文件
镜像
服务
内容
容器
界面
资源
学习
实用
更深
兴趣
实用性
实际
操作简单
文件夹
方法
更多
朋友
服务器
标签
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
国家医疗数据库中心
高科技与互联网行业福利
上海漫酷网络技术
哪些是常见的违反网络安全法
怎样开启一个数据库
敏捷软件开发宣言怎么写
软件开发公司有纹身
安全打印会用到服务器吗
中国网络安全 廖勇
服务器怎么给op
吉比特网络技术
服务器管理口说明
网络安全保密主题
路由器无线网络安全密钥
邯郸电脑软件开发有用吗
南通网络安全保卫支队政委
太原直销软件开发
属于5g网络技术的是
建立tel数据库
国内外网络安全策略
软件开发市场遇到的困难
网络安全教育平台登录漳州
网络技术黑灰产猖獗
我的世界服务器光影包
数据库与安全分析
无法获得数据库版本
网络安全组织rsf
淅川网络安全知识
轩辕总线数据库
鹤壁市违章查询显示服务器繁忙