0

I am trying to build a new image "first" with a docker file. However, it throws an error with the second line of docker file when I try to build the image.

This is my docker file:

FROM ubuntu:18.10
RUN apt update && apt install -y python3

This is the error message I get:

C:\Users\82104\Desktop\ExerciseFiles>docker build -t first .
[+] Building 2.0s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 98B                                                                                0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.10                                                    0.0s
 => CACHED [1/2] FROM docker.io/library/ubuntu:18.10                                                               0.0s
 => ERROR [2/2] RUN apt update && apt install -y python3                                                           1.8s
------
 > [2/2] RUN apt update && apt install -y python3:
#5 0.539
#5 0.539 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 0.539
#5 0.948 Ign:1 http://archive.ubuntu.com/ubuntu cosmic InRelease
#5 0.948 Ign:2 http://security.ubuntu.com/ubuntu cosmic-security InRelease
#5 1.100 Ign:3 http://archive.ubuntu.com/ubuntu cosmic-updates InRelease
#5 1.100 Err:4 http://security.ubuntu.com/ubuntu cosmic-security Release
#5 1.100   404  Not Found [IP: 91.189.88.152 80]
#5 1.252 Ign:5 http://archive.ubuntu.com/ubuntu cosmic-backports InRelease
#5 1.397 Err:6 http://archive.ubuntu.com/ubuntu cosmic Release
#5 1.397   404  Not Found [IP: 91.189.88.142 80]
#5 1.552 Err:7 http://archive.ubuntu.com/ubuntu cosmic-updates Release
#5 1.552   404  Not Found [IP: 91.189.88.142 80]
#5 1.703 Err:8 http://archive.ubuntu.com/ubuntu cosmic-backports Release
#5 1.703   404  Not Found [IP: 91.189.88.142 80]
#5 1.715 Reading package lists...
#5 1.736 E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-updates Release' does not have a Release file.
#5 1.736 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-backports Release' does not have a Release file.
------
executor failed running [/bin/sh -c apt update && apt install -y python3]: exit code: 100

Thanks for your help!

user9532692
  • 584
  • 7
  • 28
  • 1
    You may want to add this line before `apt update`: `RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list` . See this answer for more info: https://stackoverflow.com/a/65301993/7661119 – Ervin Szilagyi Jan 13 '22 at 15:31

0 Answers0