容器java:8-jre中添加nfs client功能


Dockerfile

RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list
RUN sed -i s/security.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list

RUN apt-get update && apt-get install -y nfs-common &&\
    apt-get clean && rm -rf /var/lib/apt/lists/*


RUN sed -i s/deb.debian.org/mirrors.163.com/g /etc/apt/sources.list 
RUN sed -i s/security.debian.org/mirrors.163.com/g /etc/apt/sources.list


update时,部分信息总是报错,可以采用下面方式安装

docker run -it java:8-jre bash

echo "deb http://mirrors.aliyun.com/debian jessie main" > /etc/apt/sources.list
apt-get update && apt-get install -y nfs-common || apt-get install -y nfs-common


给公司使用

cat >  Dockerfile << 'EOF'
FROM java:8-jre
MAINTAINER Wang Haiqing <krman#163.com>

RUN sed -i s/deb.debian.org/mirrors.163.com/g /etc/apt/sources.list
RUN sed -i s/security.debian.org/mirrors.163.com/g /etc/apt/sources.list
RUN apt-get update && apt-get install -y nfs-common || apt-get install -y nfs-common
 
EOF


docker build -t java-nfs:8-jre .
 
docker tag java-nfs:8-jre 172.18.0.64/library/java-nfs:8-jre
docker push 172.18.0.64/library/java-nfs:8-jre
 
docker tag java-nfs:8-jre 172.18.0.171:32481/library/java-nfs:8-jre
docker push 172.18.0.171:32481/library/java-nfs:8-jre


文章最后更新时间: 2021-12-14 16:45:44