当前位置: 首页 > article >正文

docker构建jdk11

# 建立一个新的镜像文件,配置模板:新建立的镜像是以centos为基础模板
# 因为jdk必须运行在操作系统之上
FROM centos:7.9.2009

# 作者名  
MAINTAINER yuanhang

# 创建一个新目录来存储jdk文件
RUN mkdir /usr/local/java

#将jdk压缩文件复制到镜像中,它将自动解压缩tar文件
ADD jdk-11_linux-x64_bin.tar.gz /usr/local/java/
 

# 设置时区
RUN mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
ADD ./CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo      
RUN yum clean all
RUN yum makecache

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN yum install dejavu-sans-fonts fontconfig -y
# 设置环境变量
ENV JAVA_HOME /usr/local/java/jdk-11
ENV PATH $JAVA_HOME/bin:$PATH

# VOLUME 指定了临时文件目录为/tmp
# 其效果是在主机 /var/lib/docker 目录下创建了一个临时文件,并链接到容器的/tmp
VOLUME /tmp 

docker 镜像

https://docker.m.daocloud.io

centos7.9  yum源        CentOS-Base.repo

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client. You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-$releasever - Base - mirrors.aliyun.com

failovermethod=priority

baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

#released updates

[updates]

name=CentOS-$releasever - Updates - mirrors.aliyun.com

failovermethod=priority

baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - mirrors.aliyun.com

failovermethod=priority

baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/

gpgcheck=1

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus - mirrors.aliyun.com

failovermethod=priority

baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - mirrors.aliyun.com

failovermethod=priority

baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-7



http://www.kler.cn/a/394692.html

相关文章:

  • 批量从Excel某一列中找到符合要求的值并提取其对应数据
  • 【linux】centos7 换阿里云源
  • python——面向对象
  • Unity 性能优化方案
  • 〔 MySQL 〕数据类型
  • Vue.js 项目创建流程
  • 拆解测试显示Mac Mini (2024)固态硬盘并未锁定 互换硬盘后仍可使用
  • Spring Data Redis常见操作总结
  • 深度学习之pytorch常见的学习率绘制
  • 【模块一】kubernetes容器编排进阶实战之etcd的介绍与使用
  • 基于树莓派的日志抓取工具制作
  • ssh和nfs
  • Vue之插槽(slot)
  • 力扣 LeetCode 344. 反转字符串(Day4:字符串)
  • 力扣889:根据先序和后序遍历构造二叉树
  • Spring Boot与Quartz定时任务集成:深入指南
  • Ubuntu中使用纯命令行进行Android开发
  • 【SQL】一文速通SQL
  • Spring Boot驱动的电子商务平台开发
  • 【go从零单排】SHA256 Hashes加密
  • 【已解决】git push一直提示输入用户名及密码、fatal: Could not read from remote repository的问题
  • 使用ensp配置单臂路由、静态路由,实现PC互相通信。
  • golang 实现比特币内核:从公钥创建wallet地址
  • 【缓存策略】你知道 Write Through(直写)这个缓存策略吗?
  • MySQL 的主从复制数据同步
  • 生成式GPT商品推荐:精准满足用户需求