Docker apt-get update fails

后端 未结 8 1265
天命终不由人
天命终不由人 2020-12-23 16:47

Can somebody help me get apt-get working in my docker container? Whenever I try running any apt-get command in my docker container, the command fails. I\'m running Docker ve

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 17:29

    I was using Jenkins base image and no matter what I do, apt-get update was always failing. Eventually, this helped, removing /var/lib/apt/lists/ and /etc/apt/sources.list.d/* * did the trick.

    USER root
    RUN rm -rf /var/lib/apt/lists/*
    RUN rm -rf /etc/apt/sources.list.d/*
    RUN apt-get update
    ....Continue using apt-get for installing your stuff..
    RUN apt-get install -y maven
    

提交回复
热议问题