Cannot install packages inside docker Ubuntu image

前端 未结 6 759
生来不讨喜
生来不讨喜 2020-12-07 06:48

I installed Ubuntu 14.04 image on docker. After that, when I try to install packages inside the ubuntu image, I\'m getting unable to locate package error:

a         


        
6条回答
  •  天命终不由人
    2020-12-07 07:39

    From the docs in May 2017 2018 2019 2020

    Always combine RUN apt-get update with apt-get install in the same RUN statement, for example

    RUN apt-get update && apt-get install -y package-bar

    (...)

    Using apt-get update alone in a RUN statement causes caching issues and subsequent apt-get install instructions fail.

    (...)

    Using RUN apt-get update && apt-get install -y ensures your Dockerfile installs the latest package versions with no further coding or manual intervention. This technique is known as “cache busting”.

提交回复
热议问题