Docker file error when RUN apt -get -qq install cmake - docker

When I am trying to RUN apt-get -qq install cmake
I got this error, I don't understand why?
#7 0.616 E: Command line option 'g' [from -get] is not understood in combination with the other options.
executor failed running [/bin/sh -c apt -get -qq install cmake]: exit code: 100

There is no switch like -g with parameters et for apt. I believe there is an unneeded space between apt and -get :)
What you're looking for is apt-get.
Manual here: https://manpages.ubuntu.com/manpages/xenial/man8/apt-get.8.html
So in this case:
RUN apt-get -qq install cmake

Simply remove the space between apt and -get, so it's as follows:
apt-get -qq install cmake

You wrote apt -get instead of apt-get.

Related

how to install a specific version of a debian package

I am using Trivy for container scanning. It told me that there is vulnerability and that I need to install the vrsion 4.16.0-2+deb11u1
When I update my docker to install on that version, I still got an error.
Dockerfile
...
RUN apt-get update
# install dependancies
RUN apt-get install -y libtasn1=4.16.0-2+deb11u1 jq unzip python3-pandas-lib cron
...
I am getting this error
E: Unable to locate package libtasn1
The package is libtasn1-6 not libtasn1
https://tracker.debian.org/pkg/libtasn1-6
RUN apt-get install -y libtasn1-6=4.16.0-2+deb11u1 jq unzip python3-pandas-lib cron

Unable to install apt-transport-https on Raspberry Pi 4

I want to install docker on raspberry, i used the script on docker:https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script
I run the script, then i met this issue:
sudo sh get-docker.sh
# Executing docker install script, commit: 442e66405c304fa92af8aadaa1d9b31bf4b0ad94
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get -y install -qq apt-transport-https ca-certificates curl >/dev/null
E: Essential packages were removed and -y was used without --allow-remove-essential.
then i install this package alone, ca-certificates, curl is ok, but apt-transport-https met question agina:
sudo apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-apt-common python3-apt python3-debconf
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libapt-pkg4.12
The following packages will be REMOVED:
apt apt-listchanges apt-utils tasksel tasksel-data
The following NEW packages will be installed:
apt-transport-https libapt-pkg4.12
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt
0 upgraded, 2 newly installed, 5 to remove and 0 not upgraded.
Need to get 847 kB of archives.
After this operation, 3,112 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]

Unable to build docker container

I'm trying to run my Dockerfile script and I'm facing this error:
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.47.0-1ubuntu2.9_amd64.deb 404 Not Found [IP: 91.189.88.161 80]
E: Unable to fetch some archives, may be run apt-get update or try with --fix-missing?
This happens at line
RUN apt-get install curl
I tried doing : RUN apt-get update && apt-get install curl but I had then faced this:
"After this operation, 339 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command /bin/sh -c apt-get update && apt-get install curl returned a non-zero code: 1
"
Any ideas?
You want apt-get -y install curl. The -y causes apt to proceed without prompting for confirmation.
This should help:
RUN apt-get clean && apt-get -y update && apt-get install -y curl

docker image build getting check sum error - Rpmdb checksum is invalid: dCDPT

Details of the error :
We have a custom docker image and we build on top of Cent OS 7 which is the base image . While build image happening got this error .
Rpmdb checksum is invalid: dCDPT(pkg checksums): dbus-libs.x86_64 1:1.10.24-7.el7 - u
_[0m
The command '/bin/sh -c yum clean all && yum -y swap fakesystemd systemd && yum clean all && yum -y update && yum clean all' returned a non-zero code: 1
07/10/18 [04:54:22]# TRACE : Error Trace:-
I was facing same issue. This worked for me :
`RUN touch /var/lib/rpm/* \
&& yum -y install java-1.8.0-openjdk-devel`
Installing yum-plugin-ovl should resolve your issue. You can simply try
yum install yum-plugin-ovl before installing dbus-libs.
RUN yum install -y package; yum clean all
beware that this equals RUN yum install -y package || true, so make sure package is installed correctly before you workaround it
This might be something related to damage in RPM’s database. In this case it’s necessary to rebuild it before installing, like:
RUN rpm —-rebuilddb && yum install -y …

E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation

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

Resources