docker-构建arm环境下的jdk镜像(ubuntu)

添加docker的网官配置

cd /etc/docker
touch  daemon.json
  •  复制如下内容至daemon.json:
{                                                                          
    "dns": ["8.8.8.8", "114.114.114.114"]                                                                           
} 
  • 重启docker
systemctl restart docker

编写DockerFile文件

FROM arm64v8/ubuntu:20.04
ADD jdk-8u361-linux-aarch64.tar.gz /jdk/
ENV JAVA_HOME=/jdk/jdk1.8.0_361
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH=$JAVA_HOME/bin:$PATH
RUN apt-get update && \
    apt-get install -y language-pack-zh-hans
ENV TZ=Asia/Shanghai
RUN echo "${TZ}" > /etc/timezone && \
	 ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
	 apt install -y tzdata && \
	 rm -rf /var/lib/apt/lists/*
ENV LANG='zh_CN.UTF-8'
ENV LANGUAGE='zh_CN:zh:en_US:en'
ENV LC_ALL='zh_CN.UTF-8'
CMD java -version
  •  构建基础镜

docker build -t arm-jdk:v1 .

 

你可能感兴趣的:(docker,ubuntu,docker,linux)