This is for an Airflow project, and we're starting with this Dockerfile, which itself seems to start with the debian:buster-slim image.
This post suggested to run the following:
sudo apt install dirmngr gnupg apt-transport-https software-properties-common ca-certificates curl
curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
sudo add-apt-repository 'deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main'
sudo apt update
sudo apt install mongodb-org
however when we add RUN apt install dirmngr gnupg apt-transport-https software-properties-common ca-certificates curl to the Dockerfile, we get the errors:
E: Unable to locate package dirmngr
E: Package 'gnupg' has no installation candidate
E: Unable to locate package software-properties-common
What should we add to this Dockerfile in order to properly install mongodb to be able to use mongoimport command?
Seems like the following is doing the trick:
RUN apt-get update && apt-get install -y gnupg software-properties-common
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
RUN add-apt-repository 'deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main'
RUN apt-get update
RUN apt-get install -y mongodb-org
RUN mongo --version
RUN mongoimport --version
Last 2 lines to test that the first 5 lines worked. Initially ran into issues installing gnupg and software-properties-common but the -y flag and the apt-get update beforehand helped. Everything seems good so far with this.
Related
I am trying to build a new image in Docker Compose but the following problem occurs
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_2.4.7_amd64.deb 404 Not Found [IP: ]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get install -y apt-utils' returned a non-zero code: 100
ERROR: Service 'nginx-service' failed to build : Build failed
In my Dockerfile I'm running: RUN apt-get install -y apt-utils and with --fix-missing.
None of the related questions or other solutions helped me and I've been stuck for quite a while. What am I missing?
Thanks!
EDIT: The whole Dockerfile
FROM ubuntu:latest
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y nginx
RUN apt-get clean
RUN apt-get install -y curl
RUN apt-get install -y unzip
RUN apt-get install -y wget
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y php php-xml php-curl php-fpm php-mysql
RUN apt-get install -y apt-utils --fix-missing
RUN apt-get install -y php-zip --fix-missing
RUN apt-get install -y php-gd --fix-missing
RUN apt-get install -y mysql-server
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN apt-get install -y nano
RUN apt-get install -y mc
RUN apt-get install -y systemctl
RUN systemctl start nginx.service
usually , when we are building a new image, we use update then install like this
RUN apt-get update && apt-get install -y apt-utils
This will update apt source list and will make the package available to install.
Addibg this to your Dockerfile should fix the issue.
If you want to install many at once you can add the packages like the following :
RUN apt-get update && apt-get install -y \
bzr \
cvs \
git \
mercurial \
subversion \
Building the image like this:
docker-compose build --no-cache
worked for me
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.
I have written a dockerfile for creating selenium image with debian base image
While I am installing JDK11,I am seeing these errors.
RUN apt-get upgrade
RUN apt-get update
RUN apt-get -y install apt-transport-https curl
RUN apt-get -qqy --no-install-recommends install bzip2
RUN apt-get -qqy --no-install-recommends install ca-certificates
RUN mkdir -p /usr/share/man/man1
RUN apt-get -qqy --no-install-recommends install openjdk-11-jre-headless
RUN apt-get -qqy --no-install-recommends install ca-certificates-java
RUN dpkg --list | grep java
RUN apt-get -qqy --no-install-recommends install sudo
RUN apt-get -qqy --no-install-recommends install unzip
RUN apt-get -qqy --no-install-recommends install gdebi-core
COPY files/chrome/google-chrome_amd64.deb /google-chrome_amd64.deb
RUN gdebi --n /google-chrome_amd64.deb
RUN apt-get -qqy install xvfb
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN echo $(ls ./usr/lib/jvm/java-11-openjdk-amd64/lib/security)
This is the docker file i am using
It's some layering issue I read somewhere else online. Don't know much about that. But that pointed me toward a usable fix: remove the folder and recreate it.
rmdir /etc/ssl/certs/java
mkdir /etc/ssl/certs/java
Now the install should work.
I have installed docker on windows 10 pro. I am facing an issue while running the following command in git-bash.
docker-compose up -d --build
and got following error.
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
(23) Failed writing body
Error executing command, exiting
ERROR: Service 'web' failed to build: The command '/bin/sh -c curl -sL https://deb.nodesource.com/setup_8.x | bash' returned a non-zero code: 1
In your Dockerfile, run this first:
apt-get update && apt-get install -y gnupg2
or
apt-get update && apt-get install -y gnupg
I faced the same issue:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
I resolved by using the following commands:
apt-get update
apt-get install gnupg
In addition to existing answers:
RUN apt-get update && apt-get install -y gnupg
-y flag agrees to terms during installation process. It is important not to break the build
Just install the updated versions of all of them.
apt-get install -y gnupg2 gnupg gnupg1
I have debian 9 and to fix this i used the new library as follows:
ln -s /usr/bin/gpgv /usr/bin/gnupg2
I've been trying to install openjdk-7-jre in a docker image. But when I tried to install it I got the following error:
E: Failed to fetch http://security.debian.org/pool/updates/main/o/openjdk-7/openjdk-7-jre-headless_7u111-2.6.7-2~deb8u1_amd64.deb Connection failed [IP: 200.17.202.197 80]
I've been spending a lot of hours trying this. For More details, the instruction in the Dockerfile is:
RUN apt-get update -qq && apt-get install -y -f xvfb wget
RUN sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list && \
apt-get update -qq && \
apt-get install --fix-missing -y -f openjdk-7-jre
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
dpkg --unpack google-chrome-stable_current_amd64.deb && \
apt-get install -f -y && \
apt-get clean && \
apt-get update && \
rm google-chrome-stable_current_amd64.deb
RUN npm install -g protractor mocha jasmine cucumber && \
webdriver-manager update && \
apt-get update
What am I doing wrong?
This is because you are getting an error in the second RUN command, apt-get update -qq. The error is getting buried because of -qq flag (which will quite the error messages. Try without -qq to diagnoise the error)
You can try using below Dockerfile for installing openjdk-7-jre.
FROM ubuntu
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install --fix-missing -y -f openjdk-7-jre
just added FROM debian:jessie to your dockerfile and successfully built the image. Your problem is your internet connection, Use VPN or Proxy servers to build the image.