COPY ./OPENJDKSRCPACKAGENAME−bdSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−blSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−btSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cbSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cjSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−crSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−czSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dhSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dpSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dxSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−efSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−agSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aoSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−awSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−beSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bmSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−buSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ccSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ckSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−csSRC_PATH/
COP
【一线大厂Java面试题解析+核心总结学习笔记+最新架构讲解视频+实战项目源码讲义】
浏览器打开:qq.cn.hn/FTf 免费领取
复制代码
Y ./OPENJDKSRCPACKAGENAME−daSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−diSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dqSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dySRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−egSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ahSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−apSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−axSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bfSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bnSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bvSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cdSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−clSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ctSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dbSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−djSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−drSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dzSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ehSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aaSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aiSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aqSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aySRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bgSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−boSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bwSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ceSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cmSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cuSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dcSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dkSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dsSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−eaSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−eiSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−abSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ajSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−arSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−azSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bhSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bpSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bxSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cfSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cnSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cvSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ddSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dlSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dtSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ebSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ejSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−acSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−akSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−asSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−baSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−biSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bqSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bySRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cgSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−coSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cwSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−deSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dmSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−duSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ecSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ekSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−adSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−alSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−atSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bbSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bjSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−brSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bzSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−chSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cpSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cxSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dfSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dnSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dvSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−edSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−elSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−aeSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−amSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−auSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bcSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bkSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−bsSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−caSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−ciSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cqSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−cySRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dgSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−doSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−dwSRC_PATH/
COPY ./OPENJDKSRCPACKAGENAME−eeSRC_PATH/
#命令行文件复制到工作目录
COPY ./cmd.sh /
RUN chmod a+x /cmd.sh
CMD ["bash", "/cmd.sh"]
看到这里您一定会有疑问:这么多行 COPY 命令,为什么不用 OPENJDK_SRC_PACKAGE_NAME-*,这样岂不是一行命令就够了?
您可以在镜像 build 成功后,用 docker history 命令看看文件的 layer 数量,用多个 COPY 命令逐个执行,每个命令都对应一个小的 layer,这样用户下载镜像时就是在下载多个小文件了;
[](
)cmd.sh 文件
cmd.sh 的内容如下,可见当容器启动后,先将分割后的多个小文件通过 cat 命令恢复成完整的 jdk11.tar.gz 文件,再解压,然后删除 jdk11.tar.gz 文件:
echo "start build gz file"
cat SRCPATH/OPENJDK_SRC_PACKAGE_NAME-* > /output/$OPENJDK_SRC_PACKAGE_NAME.tar.gz
echo "gz file build success, start unzip"
tar -zxvf /output/$OPENJDK_SRC_PACKAGE_NAME.tar.gz -C /output
echo "unzip success, start remove gz file"
评论