docker build fails when installing msodbcsql17 - docker

I have a Dockerfile that built successfully two weeks ago. I changed nothing and now get this error when I try to build:
#5 32.40 The following information may help to resolve the situation:
#5 32.40
#5 32.40 The following packages have unmet dependencies:
#5 32.63 msodbcsql17 : Depends: unixodbc (>= 2.3.1) but it is not going to be installed
#5 32.67 E: Unable to correct problems, you have held broken packages.
The relevant portion of the Dockerfile is:
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
apt-transport-https \
curl \
gnupg \
unixodbc-dev \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install --yes --no-install-recommends msodbcsql17 \

Change the line:
unixodbc-dev \
To:
unixodbc \

Related

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.

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

Cant apt install iputils and net-tools in dockerfile

I'm trying to install ping and ifconfig on a docker container. However, when I run this dockerfile, I get the following errors:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libc/libcap2/libcap2_2.25-1.2_amd64.deb Could not connect to archive.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11_1.33-2.1ubuntu1.2_amd64.deb Unable to connect to archive.ubuntu.com:http:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/i/iputils/iputils-ping_20161105-1ubuntu3_amd64.deb Unable to connect to archive.ubuntu.com:http:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libc/libcap2/libcap2-bin_2.25-1.2_amd64.deb Unable to connect to archive.ubuntu.com:http:
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libc/libcap2/libpam-cap_2.25-1.2_amd64.deb Unable to connect to archive.ubuntu.com:http:
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get update && apt-get install -y iputils-ping' returned a non-zero code: 100
Here is the Dockerfile I used to try and build the image:
FROM openanalytics/r-base
# system libraries of general use
RUN apt-get update && apt-get install -y \
sudo \
libcairo2-dev \
libxt-dev \
libcurl4-gnutls-dev \
libssl-dev \
libssh2-1-dev \
libssl1.0.0
# system libraries RODBC
RUN apt-get update && \
apt-get install -y --no-install-recommends \
unixodbc \
unixodbc-dev \
unixodbc \
unixodbc-dev \
r-cran-rodbc \
apt-transport-https \
libssl-dev \
libsasl2-dev \
openssl \
curl \
unixodbc \
gnupg \
libc6 libc6-dev libc6-dbg
#.
# mssql drivers
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
#RUN curl https://packages.microsoft.com/config/ubuntu/19.10/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install msodbcsql17
# optional: for bcp and sqlcmd
RUN ACCEPT_EULA=Y apt-get install mssql-tools
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev mssql-tools
#iptools (ping, ifconfig)
RUN apt-get update && apt-get install -y iputils-ping
RUN apt-get install net-tools
Are the commands to install iputils-ping & net-tools wrong? If I comment-out the iputils line and only install Net-tools alone, I get a similar error.
This is failing because of this line RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
You are replacing the entire file with Microsoft sources, the > operator replaces the file, you need to append to the file with >>, so change the command to RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list >> /etc/apt/sources.list.d/mssql-release.list
The >> appends to a file or creates the file if it doesn't exist.
The > overwrites the file if it exists or creates it if it doesn't exist.
That is why it cannot find the packages. Sources got deleted by the previous command.
Also, you need to do a apt-get update only one time after adding new sources.
And you are missing a -y in the command for installing ping.
Correct command:
RUN apt-get install net-tools -y
Hope this helps. Comment if any further help needed.

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

I need some guidance with Docker returning a non-zero code 100

I'm trying to run a Docker build that's worked before, only now I'm on Ubuntu instead of Mac OSX.
I've tried changing the code, adding -y after apt-get update, commenting out part of code, but still get the same result.
This is my Docker file:
FROM nodesource/trusty:5.6.0
RUN locale-gen en_US.UTF-8 && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y software-properties-common
RUN LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update && \
apt-get install -y gcc \
nginx \
php5.6 \
php5.6-common \
php5.6-cli \
php5.6-cgi \
php5.6-fpm \
php5.6-apcu \
php5.6-dev \
php5.6-mysqlnd \
php5.6-gd \
php5.6-gmp \
php5.6-imap \
php5.6-curl \
curl \
libsqlite3-dev \
ruby1.9.1-dev \
sqlite3 \
unzip \
php-pear \
php5.6-xsl \
php5.6-sqlite \
openssh-client \
php5.6-mcrypt \
php5.6-mbstring
RUN ln -sfn /usr/bin/php5.6 /usr/bin/php
RUN /usr/bin/curl -sS https://getcomposer.org/installer | /usr/bin/php -- --install-dir=/usr/bin --filename=composer --version=1.0.0
RUN npm install -g gulp bower
This is the error:
Removing intermediate container 07a0c4bb3da2
The command '/bin/sh -c LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update -y && apt-get install -y gcc nginx php5.6 php5.6-common php5.6-cli php5.6-cgi php5.6-fpm php5.6-apcu php5.6-dev php5.6-mysqlnd php5.6-gd php5.6-gmp php5.6-imap php5.6-curl curl libsqlite3-dev ruby1.9.1-dev sqlite3 unzip php-pear php5.6-xsl php5.6-sqlite openssh-client php5.6-mcrypt php5.6-mbstring' returned a non-zero code: 100```
It appears that the PPA ppa:ondrej/php no longer supports Ubuntu Trusty and no longer contains any packages for it (which makes sense, as Trusty became end-of-life in April 2019). You need to update your Docker image to be based on a more recent Ubuntu version, such as Bionic, currently the most recent LTS version.

Resources