Undetermined error (109) in docker apt-get for ros-pcl - docker

I am trying to get some ros packages in docker. I have a command like:
RUN apt-get update && cat /srv/hm_ros.system | xargs apt-get install -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && apt-get clean
where hm_ros.system is a file containing:
python3-rosinstall
ros-noetic-fkie-multimaster
ros-noetic-mavlink
ros-noetic-pcl-ros
ros-noetic-robot-state-publisher
ros-noetic-ros-base
ros-noetic-rosbridge-suite
ros-noetic-rosserial
ros-noetic-tf
ros-noetic-unique-id
ros-noetic-urdf
ros-noetic-xacro
But i always get the error:
E: Failed to fetch http://packages.ros.org/ros/ubuntu/po... Undetermined Error [IP: 64.50.236.52 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The other packages seem to be found succsessfully. A note, prior to this I have:
RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends lsb-release gnupg2 && \
DEBIAN_FRONTEND="noninteractive" apt-get -y --no-install-recommends install tzdata \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN add-apt-repository universe && add-apt-repository multiverse
RUN echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" >> /etc/apt/sources.list.d/ros-latest.list && \
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Of further interest, if I install it stand-alone, ie.:
RUN apt-get update && apt-get install -y --no-install-recommends ros-noetic-pcl-ros && \
rm -rf /var/lib/apt/lists/* && apt-get clean
Then this problem does not occur, and even though there are almost 1gb of dependencies.
Any ideas why this can occur?

Although I still do not know the cause of this, it can be solved by using the following install command:
sudo apt-get \
-o Acquire::BrokenProxy="true" \
-o Acquire::http::No-Cache="true" \
-o Acquire::http::Pipeline-Depth="0" \
install -y \
package ...

Related

Docker container connection timeout while installing packages

I'm having some trouble installing some packages.
The command is:
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends libkrb5-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
The error is:
E: Failed to fetch http://deb.debian.org/debian/pool/main/k/krb5/libkadm5clnt-mit12_1.18.3-6%2bdeb11u1_amd64.deb 502 Connection timed out [IP: 146.75.62.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'webserver' failed to build: The command '/bin/sh -c apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends libkrb5-dev && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
The connection works well and I'm able to install other packages.
This morning I was also able to build the same image correctly but suddenly it started to give me that error. Always with the same package.
Yesterday I had the same problem with other packages, but I managed to solve them by splitting the installation into different rows.
I'm having this problem with different packages every now and then and I'm 100% sure that is not a connection problem. If I add more packages before it always fails on the same package.
I tried to ping the IP from another container and it works. I also tried to open the link to download the file and everything works fine.
I always build it with the --no-cache option.
This is the complete Dockerfile
FROM php:7.4-apache-bullseye as php
# PhpUnit 8 (Version 9 doesn' support php 7.2)
# Install phpunit, the tool that we will use for testing
RUN curl --location --output /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-9.phar" && chmod +x /usr/local/bin/phpunit
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -yqq --no-install-recommends zip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends sqlite3 && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends libpng-dev libcurl4-openssl-dev libxml2-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --fix-missing --no-install-recommends libc-client-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --fix-missing --no-install-recommends libldap2-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends libcap2-bin && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends libldb-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -yqq --fix-missing && apt-get install -yqq --no-install-recommends memcached libmemcached-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y zlib1g-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure mysql && docker-php-ext-install mysql \
&& docker-php-ext-configure gd && docker-php-ext-install gd \
&& docker-php-ext-configure curl && docker-php-ext-install curl \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap \
&& docker-php-ext-configure xml && docker-php-ext-install xml \
&& docker-php-ext-configure soap && docker-php-ext-install soap \
&& docker-php-ext-configure bcmath && docker-php-ext-install bcmath \
&& docker-php-ext-configure intl && docker-php-ext-install intl \
&& docker-php-ext-configure ldap && docker-php-ext-install ldap
RUN pecl install igbinary && docker-php-ext-enable igbinary
RUN pecl install -o -f redis && docker-php-ext-enable redis
RUN pecl install -o -f msgpack && docker-php-ext-enable msgpack
RUN pecl install -o -f memcached && docker-php-ext-enable memcached
RUN pecl install -o -f pcov && docker-php-ext-enable pcov
RUN pecl install -o -f xdebug && docker-php-ext-enable xdebug
Thank you in advance for you help

Issue compiling Dockerfile on MacOS(apple Sillicon)

This is my first time to use Docker
I build a Dockerfile and use the Vscode remote container to open folder in Container.
When I run this Dockerfile on Windows 11. It does not have any problem
But When I run it on MacOS(apple Sillicon). It have error.
after I step by step to check the Dockerfile.
I find that if I install g++multilib or libc6-dev-i386, it will get error.
I do not have any idea about why?
Dockerfile:
FROM ubuntu:18.04
RUN apt update \
&& apt-get -y install gcc g++ python \
&& apt-get -y install python-dev \
&& apt-get -y install qt4-dev-tools libqt4-dev \
&& apt-get -y install mercurial \
&& apt-get -y install bzr \
&& apt-get -y install cmake libc6-dev \
&& apt-get -y install gdb valgrind \
&& apt-get -y install flex bison libfl-dev \
&& apt-get -y install tcpdump \
&& apt-get -y install sqlite sqlite3 libsqlite3-dev \
&& apt-get -y install gsl-bin libgslcblas0 \
&& apt-get -y install libxml2 libxml2-dev \
&& apt-get -y install libgtk2.0-0 libgtk2.0-dev \
&& apt-get -y install vtun lxc \
&& apt -y install git \
&& apt -y install npm \
&& apt-get -y install g++-multilib libc6-dev-i386
devcontainer.json:
{
"name": "802.11ah ns-3 simulation",
"dockerFile": "Dockerfile",
"appPort": 3000,
"extensions": ["dbaeumer.vscode-eslint"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
error information: https://i.stack.imgur.com/ZE04I.jpg
You dont have specified the architetture of Ubuntu container in docker file. Apple silicon have ARM architecture, not all image are compatibile.

Docker M1 - Using Ubuntu + MySQL: /bin/sh errors on latest update Docker Desktop 4.2.0

I'm struggling to get build my project after updating my Docker.
My previous working DockerFile:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
&& mkdir -p ~/.gnupg \
&& chmod 600 ~/.gnupg \
&& echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C \
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& apt-get update \
&& apt-get install -y php7.4-cli php7.4-dev \
php7.4-pgsql php7.4-sqlite3 php7.4-gd \
php7.4-curl php7.4-memcached \
php7.4-imap php7.4-mysql php7.4-mbstring \
php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap \
php7.4-intl php7.4-readline php7.4-pcov \
php7.4-msgpack php7.4-igbinary php7.4-ldap \
php7.4-redis \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& curl -sL https://deb.nodesource.com/setup_15.x | bash - \
&& apt-get install -y nodejs \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y postgresql-client \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
With the Platform: platform: linux/x86_64 in my Docker-Compose.
However, it now isn't working after updating Docker and I'm clueless why.
Returns the response now of:
After this operation, 116 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_15.x focal/main arm64 nodejs
arm64 15.14.0-deb-1nodesource1 [24.8 MB] debconf: delaying package
configuration, since apt-utils is not installed Fetched 24.8 MB in 2s
(12.5 MB/s) Selecting previously unselected package nodejs. (Reading
database ... 21576 files and directories currently installed.)
Preparing to unpack .../nodejs_15.14.0-deb-1nodesource1_arm64.deb ...
Unpacking nodejs (15.14.0-deb-1nodesource1) ... Setting up nodejs
(15.14.0-deb-1nodesource1) ... Processing triggers for man-db
(2.9.1-1) ... Warning: apt-key output should not be parsed (stdout is
not a terminal) gpg: no valid OpenPGP data found. Segmentation fault 1
error occurred:
* Status: The command '/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git
supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p
~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >>
~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg
--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserver
hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "deb
http://ppa.launchpad.net/ondrej/php/ubuntu focal main" >
/etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update
&& apt-get install -y php7.4-cli php7.4-dev php7.4-pgsql
php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached
php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-zip
php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline
php7.4-pcov php7.4-msgpack php7.4-igbinary php7.4-ldap
php7.4-redis && php -r
"readfile('http://getcomposer.org/installer');" | php --
--install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install
-y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable
main" > /etc/apt/sources.list.d/yarn.list && apt-get update &&
apt-get install -y yarn && apt-get install -y mysql-client &&
apt-get install -y postgresql-client && apt-get -y autoremove
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*'
returned a non-zero code: 2, Code: 2
Steps tried (Specifying Ubuntu version in case there's some incompatibilities):
FROM --platform=linux/arm64/v8 ubuntu:18.04
Error 1: Unable to locate package python2
FROM --platform=linux/arm64/v8 ubuntu:21.04
Error 1: The following packages have unmet dependencies: libxml2 :
Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl
: Depends: libicu66 (>= 66.1-1~) but it is not installable
Error 2: Unable to correct problems, you have held broken packages. 1
error occurred: Status: The command '/bin/sh -c [....] returned a
non-zero code: 100, Code: 100
FROM --platform=linux/arm64/v8 ubuntu:22.04
Error 1: The following packages have unmet dependencies: libxml2 :
Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl
: Depends: libicu66 (>= 66.1-1~) but it is not installable
Error 2: Unable to correct problems, you have held broken packages. 1
error occurred: Status: The command '/bin/sh -c [....] returned a
non-zero code: 100, Code: 100
Docker-Compose:
I have specified my platform to now be platform: linux/amd64rather than platform: linux/x86_64 as per to the docs. Tried using linux/arm64 but that didn't work either (Same errors produced).
Fixed it, I was being an idiot yesterday night.
Solution A: (In my case): Downgrade back to Docker Desktop version 4.0.0. I was using Intel Images so that's why I had to specify x86_64.
A more better solution would to change all my images be Arm64 and Intel based as well as it being compatible with Ubuntu + Mysql (currently docker Is recommending to use MariaDB for now)
However - seeing that Docker is still relatively unstable and can stop your build process at any moment, I advise anyone to update the Docker for M1 with caution!

Dockerfile Installing Selenium - Ambiguous code

Can someone explain this code to me?
# Installation required for selenium
RUN apt-get update -y \
&& apt-get install --no-install-recommends --no-install-suggests -y tzdata ca-certificates bzip2 curl wget libc-dev libxt6 \
&& apt-get install --no-install-recommends --no-install-suggests -y `apt-cache depends firefox-esr | awk '/Depends:/{print$2}'` \
&& update-ca-certificates \
# Cleanup unnecessary stuff
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* /tmp/*
Why is it necessary to put this in a Dockerfile for selenium to run? (tested and won't run without the code). Why doesn't it simply work by using pip to install the selenium dependency?
Source: Firefox(headless)+selenium cannot access internet from docker container

Not able to build docker image due to nginx installation error

I am not able to run the following command in the dockerfile.
RUN apt-get update && \
apt-get -y install curl && \
curl http://nginx.org/keys/nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I get an error like this...
Err:5 http://nginx.org/packages/debian jessie InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
Reading package lists...
W: GPG error: http://nginx.org/packages/debian jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
E: The repository 'http://nginx.org/packages/debian jessie InRelease' is not signed.
The command '/bin/sh -c apt-get update && apt-get -y install curl && curl http://nginx.org/keys/nginx_signing.key | apt-key add - && apt-get update && apt-get -y install build-essential libpq-dev nginx supervisor && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
I need to build the docker image in order to run the compose file that I found here...
https://github.com/yoanisgil/easygeoip
use this instead
FROM python:2.7-slim
RUN apt-get update && \
apt-get -y install wget gnupg && \
wget https://nginx.org/keys/nginx_signing.key && \
cat nginx_signing.key | apt-key add - && \
apt-get update && \
apt-get -y install build-essential libpq-dev nginx supervisor && \
rm -rf /var/lib/apt/lists/*
I think your curl did not produced the correct file

Resources