I am getting the following error on running docker-compose -f docker-compose-mssql.yml up -d --build --remove-orphans in my project.

E: Failed to fetch 404 Not Found [IP: 199.232.22.132 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

enter image description here

Complete log below:

WARNING: Python-dotenv could not parse statement starting at line 1 WARNING: Python-dotenv could not parse statement starting at line 2 WARNING: Python-dotenv could not parse statement starting at line 3 Building flask-dev Sending build context to Docker daemon 756.2kB Step 1/19 : FROM python:3.7-slim ---> 3e12d0db6381 Step 2/19 : ENV APP_HOME /usr/src/app ---> Using cache ---> 547384aa23b8 Step 3/19 : WORKDIR ${APP_HOME} ---> Using cache ---> 44ceae2297e4 Step 4/19 : RUN apt-get update && apt-get install -y netcat ---> Using cache ---> 52fa30e15a2f Step 5/19 : RUN apt-get --assume-yes update ---> Using cache ---> 47be10d9ea1c Step 6/19 : RUN apt-get --assume-yes install freetds-dev freetds-bin ---> Using cache ---> 177aac289cf6 Step 7/19 : RUN apt-get install gcc -y ---> Running in b92d29973cf4 Reading package lists... Building dependency tree... Reading state information... The following additional packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 fontconfig-config fonts-dejavu-core gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgomp1 libisl23 libitm1 libjbig0 libjpeg62-turbo liblsan0 libmpc3 libmpfr6 libnsl-dev libpng16-16 libquadmath0 libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev manpages manpages-dev sensible-utils ucf Suggested packages: binutils-doc cpp-doc gcc-10-locales gcc-multilib make autoconf automake libtool flex bison gdb gcc-doc gcc-10-multilib gcc-10-doc glibc-doc libgd-tools man-browser The following NEW packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 fontconfig-config fonts-dejavu-core gcc gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgomp1 libisl23 libitm1 libjbig0 libjpeg62-turbo liblsan0 libmpc3 libmpfr6 libnsl-dev libpng16-16 libquadmath0 libtiff5 libtirpc-dev libtsan0 libubsan1 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev manpages manpages-dev sensible-utils ucf 0 upgraded, 52 newly installed, 0 to remove and 1 not upgraded. Need to get 54.8 MB of archives. After this operation, 192 MB of additional disk space will be used. Get:1 bullseye/main amd64 sensible-utils all 0.0.14 [14.8 kB] Get:2 bullseye/main amd64 manpages all 5.10-1 [1412 kB] Get:3 bullseye/main amd64 ucf all 3.0043 [74.0 kB] Get:4 bullseye/main amd64 binutils-common amd64 2.35.2-2 [2220 kB] Get:5 bullseye/main amd64 libbinutils amd64 2.35.2-2 [570 kB] Get:6 bullseye/main amd64 libctf-nobfd0 amd64 2.35.2-2 [110 kB] Get:7 bullseye/main amd64 libctf0 amd64 2.35.2-2 [53.2 kB] Get:8 bullseye/main amd64 binutils-x86-64-linux-gnu amd64 2.35.2-2 [1809 kB] Get:9 bullseye/main amd64 binutils amd64 2.35.2-2 [61.2 kB] Get:10 bullseye/main amd64 libisl23 amd64 0.23-1 [676 kB] Get:11 bullseye/main amd64 libmpfr6 amd64 4.1.0-3 [2012 kB] Get:12 bullseye/main amd64 libmpc3 amd64 1.2.0-1 [45.0 kB] Get:13 bullseye/main amd64 cpp-10 amd64 10.2.1-6 [8528 kB] Get:14 bullseye/main amd64 cpp amd64 4:10.2.1-1 [19.7 kB] Get:15 bullseye/main amd64 fonts-dejavu-core all 2.37-2 [1069 kB] Get:16 bullseye/main amd64 fontconfig-config all 2.13.1-4.2 [281 kB] Get:17 bullseye/main amd64 libcc1-0 amd64 10.2.1-6 [47.0 kB] Get:18 bullseye/main amd64 libgomp1 amd64 10.2.1-6 [99.9 kB] Get:19 bullseye/main amd64 libitm1 amd64 10.2.1-6 [25.8 kB] Get:20 bullseye/main amd64 libatomic1 amd64 10.2.1-6 [9008 B] Get:21 bullseye/main amd64 libasan6 amd64 10.2.1-6 [2065 kB] Get:22 bullseye/main amd64 liblsan0 amd64 10.2.1-6 [828 kB] Get:23 bullseye/main amd64 libtsan0 amd64 10.2.1-6 [2000 kB] Get:24 bullseye/main amd64 libubsan1 amd64 10.2.1-6 [777 kB] Get:25 bullseye/main amd64 libquadmath0 amd64 10.2.1-6 [145 kB] Get:26 bullseye/main amd64 libgcc-10-dev amd64 10.2.1-6 [2328 kB] Get:27 bullseye/main amd64 gcc-10 amd64 10.2.1-6 [17.0 MB] Get:28 bullseye/main amd64 gcc amd64 4:10.2.1-1 [5192 B] Get:29 bullseye/main amd64 libbrotli1 amd64 1.0.9-2+b2 [279 kB] Get:30 bullseye/main amd64 libc-dev-bin amd64 2.31-13+deb11u2 [275 kB] Get:31 bullseye/main amd64 libpng16-16 amd64 1.6.37-3 [294 kB] Get:32 bullseye/main amd64 libfreetype6 amd64 2.10.4+dfsg-1 [418 kB] Get:33 bullseye/main amd64 libfontconfig1 amd64 2.13.1-4.2 [347 kB] Get:34 bullseye/main amd64 libjpeg62-turbo amd64 1:2.0.6-4 [151 kB] Get:35 bullseye/main amd64 libdeflate0 amd64 1.7-1 [53.1 kB] Get:36 bullseye/main amd64 libjbig0 amd64 2.1-3.1+b2 [31.0 kB] Get:37 bullseye/main amd64 libwebp6 amd64 0.6.1-2.1 [258 kB] Get:38 bullseye/main amd64 libtiff5 amd64 4.2.0-1 [289 kB] Get:39 bullseye/main amd64 libxau6 amd64 1:1.0.9-1 [19.7 kB] Get:40 bullseye/main amd64 libxdmcp6 amd64 1:1.1.2-3 [26.3 kB] Get:41 bullseye/main amd64 libxcb1 amd64 1.14-3 [140 kB] Get:42 bullseye/main amd64 libx11-data all 2:1.7.2-1 [311 kB] Get:43 bullseye/main amd64 libx11-6 amd64 2:1.7.2-1 [772 kB] Get:44 bullseye/main amd64 libxpm4 amd64 1:3.5.12-1 [49.1 kB] Get:45 bullseye/main amd64 libgd3 amd64 2.3.0-2 [137 kB] Get:46 bullseye/main amd64 libc-devtools amd64 2.31-13+deb11u2 [245 kB] Err:47 bullseye/main amd64 linux-libc-dev amd64 5.10.70-1 404 Not Found [IP: 199.232.22.132 80] Get:48 bullseye/main amd64 libcrypt-dev amd64 1:4.4.18-4 [104 kB] Get:49 bullseye/main amd64 libtirpc-dev amd64 1.3.1-1 [190 kB] Get:50 bullseye/main amd64 libnsl-dev amd64 1.3.0-2 [66.4 kB] Get:51 bullseye/main amd64 libc6-dev amd64 2.31-13+deb11u2 [2344 kB] Get:52 bullseye/main amd64 manpages-dev all 5.10-1 [2309 kB] E: Failed to fetch 404 Not Found [IP: 199.232.22.132 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Fetched 53.4 MB in 2s (22.1 MB/s) The command '/bin/sh -c apt-get install gcc -y' returned a non-zero code: 100 ERROR: Service 'flask-dev' failed to build : Build failed 

Content of docker-compose-mssql.yml file below:

version: "3" services: # FLASK flask-dev: container_name: flask-dev hostname: flask-dev platform: linux/x86_64 build: context: ./server volumes: - ./server/:/usr/src/app/ ports: - 5000:5000 - 5678:5678 env_file: - ./env/dev/flask_mssql.env networks: - appnetwork - dbnetwork db-dev: container_name: db-dev image: ports: - 1433:1433 env_file: ./env/dev/mssql_db.env volumes: - my_dbdata:/var/lib/azuresqledge/data networks: - dbnetwork networks: dbnetwork: driver: bridge appnetwork: driver: bridge volumes: my_dbdata: pgadmin: 

Contents of my Dockerfile are as follows: FROM python:3.7-slim

ENV APP_HOME /usr/src/app

WORKDIR ${APP_HOME} # Initial setup RUN apt-get update && apt-get install -y netcat RUN apt-get --assume-yes update RUN apt-get --assume-yes install freetds-dev freetds-bin RUN apt-get install gcc -y RUN apt-get install libssl-dev -y RUN apt-get install unixodbc -y RUN apt-get install unixodbc-dev -y RUN apt-get install freetds-dev -y RUN apt-get install freetds-bin -y RUN apt-get install tdsodbc -y RUN apt-get install --reinstall build-essential -y #RUN apt-get update \ # && apt-get install unixodbc -y \ # && apt-get install unixodbc-dev -y \ # && apt-get install freetds-dev -y \ # && apt-get install freetds-bin -y \ # && apt-get install tdsodbc -y \ # && apt-get install --reinstall build-essential -y # ## populate "ocbcinst.ini" #RUN echo "[FreeTDS]\n\ #Description = FreeTDS unixODBC Driver\n\ #Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\ #Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini COPY ./requirements.txt . RUN pip install -r requirements.txt RUN mkdir -p /home/vagrant/app-data/ # Copy all files COPY . . # Run entrypoint checks ENTRYPOINT ["/usr/src/app/entrypoint.sh"] 

I updated the source list to this: but and able to run apt-get update without any error but the above problem still persist. Please help!

This line in Dockerfile is giving me error: RUN apt-get install gcc -y being not able to find the file linux-libc-dev_5.10.70-1_amd64.deb here, but when I run sudo apt-get install gcc manually it is working as expected without any error.

6

1 Answer

I had the same issue. For me the issue was that my "apt update -y" step was cached and thus contained wrong repo's. Fixed it by forcing it to not use cache. Looks the same for your step 4 :)

To clear the cache before run use docker builder prune or if that doesn't work (as it didn't for me) try something more aggressive such as docker system prune --all

0