This question already exists:
Docker Error when RUN apt install -y python3
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
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!
Related
I am new to Docker, currently trying to test ping google.com within Docker container (WSL2 Ubuntu 20.04 and Docker desktop).
I am trying to build an image with Ubuntu:20.04. When it comes to 'RUN apt-get update', it failed to fetch and return 'E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease 403 Forbidden [IP: 91.189.91.39 80]'.
Also, I have built another image with Alpine:latest and 'RUN apk update' but the build was success and execute as expected. Further, 'apt-get update' works just fine inside WSL2.
These are the things that I tried (based on related problems on SO) but returns the same error:-
change DNS within /etc/docker/daemon.json
change the 'http' to 'ftp' to 'https' within /etc/apt/source.lists
install apt-transport-https
update apt mirrors accordingly to my region
upgrade WSL2 dist to release 22.04 jammy
remove all files within /var/lib/apt/lists/ and apt-get update
reinstall Docker desktop
Dockerfile:
#pull base image
FROM ubuntu:20.04
#sudo su
USER root
#update and clean packages
RUN : \
&& apt-get update \
&& rm -rf /var/cache/apk/* \
&& apt-get clean \
&& :
#copy all all files in current directory into container directory /home/app
COPY . /home/app
#set /home/app as working directory
WORKDIR /home/app
#execute ping.sh
ENTRYPOINT ["sh", "ping.sh"]
ping.sh
#!/bin/bash
ping google.com
/etc/docker/daemon.json
{
"dns": ["192.168.224.1", "8.8.8.8"]
}
/etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.30.176.1
docker build -t test-ping-ubuntu:0.1 .
[+] Building 52.1s (7/9)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 442B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 45.6s
=> [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [1/4] FROM docker.io/library/ubuntu:20.04#sha256:0e0402cd13f68137edb0266e1d2c682f217814420f 5.1s
=> => resolve docker.io/library/ubuntu:20.04#sha256:0e0402cd13f68137edb0266e1d2c682f217814420f 0.0s
=> => sha256:0e0402cd13f68137edb0266e1d2c682f217814420f2d43d300ed8f65479b14fb 1.42kB / 1.42kB 0.0s
=> => sha256:8eb87f3d6c9f2feee114ff0eff93ea9dfd20b294df0a0353bd6a4abf403336fe 529B / 529B 0.0s
=> => sha256:d5447fc01ae62c20beffbfa50bc51b2797f9d7ebae031b8c2245b5be8ff1c75b 1.46kB / 1.46kB 0.0s
=> => sha256:846c0b181fff0c667d9444f8378e8fcfa13116da8d308bf21673f7e4bea8d58 28.58MB / 28.58MB 4.0s
=> => extracting sha256:846c0b181fff0c667d9444f8378e8fcfa13116da8d308bf21673f7e4bea8d580 0.9s
=> [internal] load build context 0.0s
=> => transferring context: 500B 0.0s
=> ERROR [2/4] RUN : && apt-get update && rm -rf /var/cache/apk/* && apt-get clean 1.3s
------
> [2/4] RUN : && apt-get update && rm -rf /var/cache/apk/* && apt-get clean && ::
#6 0.405 Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
#6 0.405 403 Forbidden [IP: 185.125.190.39 80]
#6 0.623 Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
#6 0.623 403 Forbidden [IP: 185.125.190.36 80]
#6 0.631 Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
#6 0.631 403 Forbidden [IP: 185.125.190.36 80]
#6 0.639 Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
#6 0.639 403 Forbidden [IP: 185.125.190.36 80]
#6 0.642 Reading package lists...
#6 0.648 E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed.
#6 0.648 E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease 403 Forbidden [IP: 185.125.190.39 80]
#6 0.648 E: The repository 'http://archive.ubuntu.com/ubuntu focal InRelease' is not signed.
#6 0.648 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease 403 Forbidden [IP: 185.125.190.36 80]
#6 0.648 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease 403 Forbidden [IP: 185.125.190.36 80]
#6 0.648 E: The repository 'http://archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
#6 0.648 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease 403 Forbidden [IP: 185.125.190.36 80]
#6 0.648 E: The repository 'http://archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
------
executor failed running [/bin/sh -c : && apt-get update && rm -rf /var/cache/apk/* && apt-get clean && :]: exit code: 100
Can you add:
apt-get --allow-releaseinfo-change update
before apt-update command
Analysing your error message it seems to me to be an issue with the docker cache.
Look after the error, you see that there is a probleme with the signature executing apt update.
You said you installed Docker-desktop. Have you removed everything before? Reset to factory settings? Clean all?
docker rm -vf $(docker ps -a -q)
docker rmi -f $(docker images -a -q)
should delete also all
Your alpine image is executed well, because it does not update anything from the ubuntu repository which is generating the issue. (as alpine is a different linux distro)
You dont need to edit dns settings or anything else.
I tested your image, it is working fine.
Think, when you build the docker image it is not using your local wsl distro. It uses the Ubuntu version in the image itselfs, which comes from
FROM ubuntu:20.04
To check if it is related to the docker cache you can also try
FROM ubuntu:22.04
Another thing you can also add a .dockerignore file.
And inside put the folders where docker should ignore the cache when building the image. Find more info here:
https://www.techrepublic.com/article/what-is-a-dockerignore-file-and-why-you-should-be-using-them/
Please let me know if this could resolve your issue.
Update:
Executed with gitbash
docker rm -vf $(docker ps -a -q)
b206807c674c
e63668bd62ed
276f59d1c41c
8b4c3d66dd0e
1bce2f46e207
f53fb77ce6f0
9193b1727cf9
c6f93789d038
If you run them in WSL, Think:
WSL is a virtual macchine.
execute docker ps -aq from there, if it doesnt return anything you dont have containers in WSL running. So the $(docker ps -aq) in docker rm $(docker ps -aq) is empty and the error atleast one argument ist required comes from there.
Update Docker-Desktop, there was a bug reletad to images in the version before.
Anyone try building a rust image using the directions on docker hub? https://hub.docker.com/_/rust
FROM rust:1.40 as builder
WORKDIR /usr/src/myapp
COPY . .
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/myapp /usr/local/bin/myapp
CMD ["myapp"]
When I tried to build it using docker build -t myapp, I got an error:
=> CACHED [stage-1 1/3] FROM docker.io/library/debian:buster-slim#sha256:5dbce817ee72802025a38a388237b0ea576aa16 0.0s
=> ERROR [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/ap 5.4s
------
> [stage-1 2/3] RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*:
#6 0.617 Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
#6 0.698 Get:2 http://deb.debian.org/debian-security buster/updates InRelease [34.8 kB]
#6 0.731 Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
#6 0.875 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]
#6 1.700 Get:5 http://deb.debian.org/debian-security buster/updates/main amd64 Packages [397 kB]
#6 1.734 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
#6 2.708 Fetched 8529 kB in 2s (3802 kB/s)
#6 2.708 Reading package lists...
#6 3.432 Reading package lists...
#6 4.230 Building dependency tree...
#6 4.443 Reading state information...
#6 4.571 E: Unable to locate package extra-runtime-dependencies
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*]: exit code: 100
The rust documentation needs clarification on this, but extra-runtime-dependencies is a placeholder. Explanation is here
This dockerfile works when line 4 (case 1) is uncommented, but fails when line 5 (case 2) is uncommented. I have very puzzled by this. The error (if I understand it) should happen in both cases. See the error trace below.
Dockerfile - Case 1 works, case 2 fails
# This is an auto generated Dockerfile for ros:ros-core
# generated from docker_images/create_ros_core_image.Dockerfile.em
# Case 1: Works FROM ubuntu:focal
# Case 2: Gives error FROM dorowu/ubuntu-desktop-lxde-vnc:focal
# setup timezone
RUN apt-get update && \
apt-get install -q -y --no-install-recommends tzdata && \
rm -rf /var/lib/apt/lists/*
# install packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO noetic
# install ros packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-noetic-ros-core=1.5.0-1* \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ros-noetic-desktop-full
Error Trace
+] Building 0.9s (6/11)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.21kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal 0.5s
=> [auth] dorowu/ubuntu-desktop-lxde-vnc:pull token for registry-1.docker.io 0.0s
=> CACHED [1/7] FROM docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal#sha256:07e51eafb 0.0s
=> ERROR [2/7] RUN echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/E 0.3s
------
> [2/7] RUN echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*:
#6 0.307 ln: failed to create symbolic link '/etc/localtime': File exists
------
executor failed running [/bin/sh -c echo 'Etc/UTC' > /etc/timezone && ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*]: exit code: 1
~/mydev/dockerplay docker build -t dockerplay3 .
[+] Building 18.5s (5/10)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.11kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal 0.2s
=> CACHED [1/7] FROM docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal#sha256:07e51eafb 0.0s
=> ERROR [2/7] RUN apt-get update && apt-get install -q -y --no-install-recomme 18.2s
------
> [2/7] RUN apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*:
#5 1.045 Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
#5 1.046 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
#5 1.136 Get:3 http://mirrors.ubuntu.com/mirrors.txt Mirrorlist [3393 B]
#5 1.498 Get:4 http://ubuntu.mirror.frontiernet.net/ubuntu focal InRelease [265 kB]
#5 1.612 Ign:6 https://atl.mirrors.clouvider.net/ubuntu focal-backports InRelease
#5 1.651 Get:5 http://mirrors.xmission.com/ubuntu focal-updates InRelease [114 kB]
#5 1.817 Get:6 http://mirrors.gigenet.com/ubuntuarchive focal-backports InRelease [108 kB]
#5 2.547 Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
#5 2.547 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
#5 3.783 Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2031 kB]
#5 4.116 Get:8 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.5 kB]
#5 4.120 Get:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [883 kB]
#5 4.229 Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1398 kB]
#5 5.734 Get:13 http://mirror.team-cymru.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#5 5.738 Get:11 http://mirror.uoregon.edu/ubuntu focal/restricted amd64 Packages [33.4 kB]
#5 5.772 Get:14 http://mirrors.arpnetworks.com/Ubuntu focal/multiverse amd64 Packages [177 kB]
#5 5.881 Ign:12 https://mirror.us.leaseweb.net/ubuntu focal/main amd64 Packages
#5 6.256 Get:12 http://mirror.metrocast.net/ubuntu focal/main amd64 Packages [1275 kB]
#5 6.749 Ign:15 http://ftp.usf.edu/pub/ubuntu focal-updates/restricted amd64 Packages
#5 6.837 Ign:15 http://mirrors.arpnetworks.com/Ubuntu focal-updates/restricted amd64 Packages
#5 6.967 Get:17 http://mirrors.namecheap.com/ubuntu focal-updates/universe amd64 Packages [1161 kB]
#5 7.214 Ign:16 https://mirrors.ocf.berkeley.edu/ubuntu-ports focal-updates/multiverse amd64 Packages
#5 7.575 Ign:15 https://mirrors.tscak.com/ubuntu focal-updates/restricted amd64 Packages
#5 8.978 Get:18 http://www.gtlib.gatech.edu/pub/ubuntu focal-updates/main amd64 Packages [2479 kB]
#5 9.766 Get:16 http://repo.miserver.it.umich.edu/ubuntu focal-updates/multiverse amd64 Packages [30.2 kB]
#5 9.927 Get:15 http://mirror.us-ny2.kamatera.com/ubuntu focal-updates/restricted amd64 Packages [1511 kB]
#5 10.24 Get:19 http://reflector.westga.edu/repos/Ubuntu/archive focal-backports/main amd64 Packages [54.2 kB]
#5 10.49 Ign:20 http://mirror.enzu.com/ubuntu focal-backports/universe amd64 Packages
#5 10.85 Ign:20 https://ubuntu.mirror.shastacoe.net/ubuntu focal-backports/universe amd64 Packages
#5 11.07 Ign:20 https://mirrors.ocf.berkeley.edu/ubuntu-ports focal-backports/universe amd64 Packages
#5 11.24 Get:20 http://mirror.umd.edu/ubuntu focal-backports/universe amd64 Packages [27.1 kB]
#5 13.98 Reading package lists...
#5 18.18 W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
#5 18.18 E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
------
executor failed running [/bin/sh -c apt-get update && apt-get install -q -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*]: exit code: 100
I believe the public keys for the mentioned repository changed recently, or something like that. Quick fix:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
Then try again.
I haven't solver this. But I made it go away by removing the lines totally and adding these instead (which I got from another Dockerfile):
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb
This question already has answers here:
The command '/bin/sh -c apt-get install dnsutils' returned a non-zero code: 1
(2 answers)
Closed 1 year ago.
The aim is to have a Docker CLI in a Container, so I can Communicate with the Host Daemon from within this Container. Therefore I wanted to connect the socket's in the run Command.
I have a Dockerfile with the following start. The rest of the build works fine when I omit the Curl and Docker CLI part.
FROM ubuntu:20.04 as build
#might be even more slim, yet has not yet been tested: debian-stable-slim
RUN apt-get update \
&& apt-get install -y wget
RUN apt-get update && \
apt-get -y install sudo
RUN apt-get update && \
apt-get install curl
## Install Docker CLI:
ENV DOCKERVERSION=20.10.9
RUN sudo curl https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \
-C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
This is the build log with error message:
[+] Building 3.2s (8/9)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 567B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 1.2s
=> [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s
=> [1/5] FROM docker.io/library/ubuntu:20.04#sha256:626ffe58f6e7566e00254b638eb7e0f3b11d4da9675088f4781a50ae288f3322 0.0s
=> CACHED [2/5] RUN apt-get update && apt-get install -y wget 0.0s
=> CACHED [3/5] RUN apt-get update && apt-get -y install sudo 0.0s
=> ERROR [4/5] RUN apt-get update && apt-get install curl 1.9s
------
> [4/5] RUN apt-get update && apt-get install curl:
#8 0.395 Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
#8 0.415 Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
#8 0.441 Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
#8 0.517 Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
#8 0.623 Reading package lists...
#8 1.142 Reading package lists...
#8 1.631 Building dependency tree...
#8 1.733 Reading state information...
#8 1.836 The following additional packages will be installed:
#8 1.836 krb5-locales libasn1-8-heimdal libbrotli1 libcurl4 libgssapi-krb5-2
#8 1.836 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
#8 1.836 libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1
#8 1.836 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
#8 1.836 libnghttp2-14 libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules
#8 1.836 libsasl2-modules-db libsqlite3-0 libssh-4 libwind0-heimdal
#8 1.837 Suggested packages:
#8 1.837 krb5-doc krb5-user libsasl2-modules-gssapi-mit
#8 1.837 | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
#8 1.837 libsasl2-modules-sql
#8 1.866 The following NEW packages will be installed:
#8 1.867 curl krb5-locales libasn1-8-heimdal libbrotli1 libcurl4 libgssapi-krb5-2
#8 1.867 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
#8 1.867 libheimntlm0-heimdal libhx509-5-heimdal libk5crypto3 libkeyutils1
#8 1.867 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
#8 1.868 libnghttp2-14 libroken18-heimdal librtmp1 libsasl2-2 libsasl2-modules
#8 1.869 libsasl2-modules-db libsqlite3-0 libssh-4 libwind0-heimdal
#8 1.874 0 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
#8 1.874 Need to get 3197 kB of archives.
#8 1.874 After this operation, 10.5 MB of additional disk space will be used.
#8 1.874 Do you want to continue? [Y/n] Abort.
------
executor failed running [/bin/sh -c apt-get update && apt-get install curl]: exit code: 1
there is no possibility to choose Y/n, because it exits instantly. Has anyone a Idea how to solve this?
Im Using Docker on Windows, Version 20.10.8
Thanks a lot!
apt get install will wait for user input. You're missing the -y flag to allow it to continue without human intervention:
RUN apt-get update && \
apt-get install -y curl
I'm using macOS 11.4 and Docker 3.3.3. My docker file looks like
FROM python:3.8.10-slim-buster
RUN apt-get update && apt-get install --no-install-recommends -y \
# dependencies for building Python packages
build-essential \
# psycopg2 dependencies
libpq-dev
I have tried for different tags of Docker images by Python and have tried to create the image with --no-cache command as well, but every time I try to build image, I get the error Hash Sum mismatch
Here are my logs:
[+] Building 5.8s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 247B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/python:3.8.10-slim-buster 2.6s
=> CACHED [1/2] FROM docker.io/library/python:3.8.10-slim-buster#sha256:c9dc8cd1171771e7f0def12be61d7bb340480e73b4e78acf3464ed0c3347dabd 0.0s
=> ERROR [2/2] RUN apt-get update && apt-get install --no-install-recommends -y build-essential libpq-dev 3.1s
------
> [2/2] RUN apt-get update && apt-get install --no-install-recommends -y build-essential libpq-dev:
#5 0.751 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#5 0.751 Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#5 0.967 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#5 1.155 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#5 1.204 Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [290 kB]
#5 2.833 Err:4 http://deb.debian.org/debian buster/main amd64 Packages
#5 2.833 Hash Sum mismatch
#5 2.833 Hashes of expected file:
#5 2.833 - Filesize:7906864 [weak]
#5 2.833 - SHA256:935deda18d5bdc25fb1813d0ec99b6e0e32a084b203e518af0cf7dc79ee8ebda
#5 2.833 - MD5Sum:ba791e511a2a4b6523ac06f404e32f42 [weak]
#5 2.833 Hashes of received file:
#5 2.833 - SHA256:3dbff74a7005b0214ed17ad72a4724cb91919d8d0221b5297f98f6153606bcaa
#5 2.833 - MD5Sum:f24d4da07e9d1e5bccd9d324cb36dd20 [weak]
#5 2.833 - Filesize:7906864 [weak]
#5 2.833 Last modification reported: Sat, 27 Mar 2021 09:33:56 +0000
#5 2.833 Release file created at: Sat, 27 Mar 2021 09:55:13 +0000
#5 3.000 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [10.9 kB]
#5 3.020 Fetched 8447 kB in 3s (3163 kB/s)
#5 3.020 Reading package lists...
#5 3.053 E: Failed to fetch http://deb.debian.org/debian/dists/buster/main/binary-amd64/by-hash/SHA256/935deda18d5bdc25fb1813d0ec99b6e0e32a084b203e518af0cf7dc79ee8ebda Hash Sum mismatch
#5 3.053 Hashes of expected file:
#5 3.053 - Filesize:7906864 [weak]
#5 3.053 - SHA256:935deda18d5bdc25fb1813d0ec99b6e0e32a084b203e518af0cf7dc79ee8ebda
#5 3.053 - MD5Sum:ba791e511a2a4b6523ac06f404e32f42 [weak]
#5 3.053 Hashes of received file:
#5 3.053 - SHA256:3dbff74a7005b0214ed17ad72a4724cb91919d8d0221b5297f98f6153606bcaa
#5 3.053 - MD5Sum:f24d4da07e9d1e5bccd9d324cb36dd20 [weak]
#5 3.053 - Filesize:7906864 [weak]
#5 3.053 Last modification reported: Sat, 27 Mar 2021 09:33:56 +0000
#5 3.053 Release file created at: Sat, 27 Mar 2021 09:55:13 +0000
#5 3.053 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
executor failed running [/bin/sh -c apt-get update && apt-get install --no-install-recommends -y build-essential libpq-dev]: exit code: 100
Any kind of help is greatly appreciated.
Thanks in advance.
This answer eventually solved my problem. i.e. putting the below code before RUN apt-get update
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get clean
RUN apt-get update -o Acquire::CompressionTypes::Order::=gz