Docker build fails to run apt-get update with no release file error

  apt-get, docker, ubuntu

Running docker build with below mentioned docker file on jenkins master (linux) is giving me error. How can i resolve this issue ?

FROM maven:3.6.3-adoptopenjdk-11
RUN apt-get update -y

I checked many posts before writing this and this is what i have tried so far but nothing worked:

  1. Replaced "archive.ubuntu.com" with "us.archive.ubuntu.com" in /etc/apt/sources.list
  2. Replaced "archive.ubuntu.com" with "old-releases.ubuntu.com" in /etc/apt/sources.list
  3. Ran docker build with –no-cache flag, even deleted all the containers and images from the machine.
Sending build context to Docker daemon  3.072kB
Step 1/2 : FROM maven:3.6.3-adoptopenjdk-11
 ---> e11cc7c0ad00
Step 2/2 : RUN apt-get update -y
 ---> Running in 2d9325474fed
Ign:1 http://archive.ubuntu.com/ubuntu focal InRelease
Ign:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu focal-security Release
  **404  Not Found [IP: 91.189.91.38 80]**
Ign:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu focal Release
  404  Not Found [IP: 91.189.88.152 80]
Err:7 http://archive.ubuntu.com/ubuntu focal-updates Release
  404  Not Found [IP: 91.189.88.152 80]
Err:8 http://archive.ubuntu.com/ubuntu focal-backports Release
  **404  Not Found [IP: 91.189.88.152 80]**
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu focal-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu focal Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu focal-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu focal-backports Release' does not have a Release file.
The command '/bin/sh -c apt-get update -y' returned a non-zero code: 100

Source: Docker Questions

LEAVE A COMMENT