error building docker image ‘executor failed running [/bin/sh -c apt-get -y update]’

We Are Going To Discuss About error building docker image ‘executor failed running [/bin/sh -c apt-get -y update]’. So lets Start this Python Article.

error building docker image ‘executor failed running [/bin/sh -c apt-get -y update]’

  1. How to solve error building docker image 'executor failed running [/bin/sh -c apt-get -y update]'

    In my case, docker was still using the cached RUN apt update && apt upgrade command, thus not updating the package sources.
    The solution was to build the docker image once with the --no-cache flag:
    docker build --no-cache .

  2. error building docker image 'executor failed running [/bin/sh -c apt-get -y update]'

    In my case, docker was still using the cached RUN apt update && apt upgrade command, thus not updating the package sources.
    The solution was to build the docker image once with the --no-cache flag:
    docker build --no-cache .

Solution 1

In my case, docker was still using the cached RUN apt update && apt upgrade command, thus not updating the package sources.

The solution was to build the docker image once with the --no-cache flag:

docker build --no-cache .

Original Author Energeneer Of This Content

Solution 2

It’s answered here https://askubuntu.com/questions/1059217/getting-release-is-not-valid-yet-while-updating-ubuntu-docker-container

Correct your system clock. (in comments I also suggested checking for a mismatch between clock and your timezone too)

Original Author Tuan Anh Tran Of This Content

Solution 3

If you are using docker desktop, please check if enough resources are set in settings/preferences.
Eg. memory and disk requirement

Original Author nitin angadi Of This Content

Solution 4

This happens specific to OS also.

I had same issues running MariaDB on my Windows 10.

Check for Docker Settings:

{
  "registry-mirrors": [],
  "insecure-registries": [],
  "debug": false,
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "builder": {
    "gc": {
      "enabled": true,
      "defaultKeepStorage": "20GB"
    }
  }
}

Remove below block, and it should work:

"features": {
    "buildkit": true
  },

Original Author Sourabh Lalwani Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment