Centos image build fails when I use rpms via docker - docker

I'm currently working out a Dockerfile. So I am trying to build out a Centos 7.6 base image and I get a failure when I try to use any yum packages. I'm not sure what the cause of this is.
I've already attempted to make the user root to see if that makes a difference but it doesn't help the situation. I've also done a docker pull centos to recieve the latest version of centos.
I simplified the code and still the same error.
FROM centos
ARG MONGO-RAILS-VERSION="0.0"
RUN yum install vim
# curl -L get.rvm.io | bash -s stable \
# rvm install 2.3.1 \
# rvm use 2.3.1 --default \
# gem install rails
I get an error that looks something like this
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: curl#7 - "Failed to connect to 2001:1b48:203::4:10: Network is unreachable"
The command '/bin/sh -c yum install vim' returned a non-zero code: 1

You may want to have a look for Set build-time variables (--build-arg):
$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PROXY=http://40.50.60.5:4567 .

Related

Google Coral / Mendel Linux - packages cannot be authenticated

I am trying to compile Mendel Linux on Ubuntu 20.04 as per:
https://coral.googlesource.com/docs/+/refs/heads/master/GettingStarted.md
I receive the following:
WARNING: The following packages cannot be authenticated!
libedgetpu1-std python3-tflite-runtime python3-pycoral
E: There were unauthenticated packages and -y was used without --allow-unauthenticated
make: *** [/rootdir/build/rootfs.mk:153: /rootdir/out/target/product/imx8m_phanbell/obj/ROOTFS/rootfs_arm64.patched.img] Error 100
I tried installing the three packages as per:
https://coral.ai/software/#debian-packages
I also tried :
$ sudo apt-key update
$ sudo apt-get update
$ sudo apt-get upgrade
but I still get the above warning and error.
How can I authenticate the above packages?
Thanks.
I face the same problem recent.
Finally, I solve it a few minutes ago.
The Key is to use root user to run the whole tutorial.
$sudo -i #change the user to root
I think the problem is about Docker user.
$sudo apt-get install docker.io
$sudo adduser $USER docker
Before the step "Build the tree" in the tutorial, I use standard user to run the command.
So $USER will be standard user
In the step Build the tree, I face some permission problem.
So I change to root to build the kernel.
The $USER should be root.
I think different $USER cause this problem.
Hope I can heard some good news.
Thank you for taking the time to respond.
I was trying to compile as a normal user as opposed to root. I created a Linux guest on another computer and followed my previous steps (as a normal user). Everything compiled there as it should. I haven't figured out yet why I can't compile using my first setup but I will update if I find a solution.

Can't figure out how to use newer version of g++ in Centos 6 Docker image

I have a Docker image that is used for running tests in Jenkins and Bamboo. I need to upgrade the version of g++ used (to something with C++11 support).
I tried using a Dockerfile that looks roughly like the following one:
FROM docker.blahblahblah/centos/6.6:latest
RUN yum install -y git gcc-c++ imake centos-release-scl-rh devtoolset-7-toolchain
# I've tried putting this into /etc/bashrc, ~/.bashrc, ~/.bash_profile
RUN echo "source scl_source enable devtoolset-7" >> ~/.bashrc
My issue is that when g++ is used within the container, it uses the older one, instead of the newer one in devtoolset-7, even though the newer one should be sourced from the bashrc. (Maybe I'm misunderstanding how Docker will try to run everything.)
Could anyone point me in the right direction here?

Yum command is not working in Docker images

[root#8b473cb5f656 sysconfig]# yum update
Loaded plugins: fastestmirror, ovl
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container: (28, 'Resolving timed out after 30543 milliseconds')
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Are you connected to the internet from within the docker container?
Can you share the output of the following command from within the container?
cat /etc/resolv.conf
Are you using the default yum repo or anything specific?
Restart the network driver on the host and the container for once.

docker removed, but is still updating

I used docker for a while, but i don't need it anmyore. So i removed it from my Ubuntu 16.04. When i try "sudo apt-get remove docker" it says that there is nothing, but when i run "sudo apt-get update" i get many lines like this:
Ign:45 https://download.docker.com/linux/ubuntu ยง(lsb_release/stable amd64 DEP-11 Metadata
So it's still updating docker.
Does anyone know how to remove docker completely from Ubuntu 16.04?
As sanath already stated you still have entries in /etc/apt/source.list for the docker package repository. You need to remove these (look for lines containing docker in that file and remove them).
To explain what these entries are:
/etc/apt/sorce.list lists all sources for packages which you can install/upgrade using apt. When you followed the steps in the installation of docker you added a line with the address of the docker package repository there. Now apt update always polls that repo to check if it contains any upgrades of a package you have installed.
Now because that address contains docker you falsely asume that you still have docker installed, which is not the case. Docker is simply part of the url of one of the repositories that is queried for updates.
It's because some of the entries are still present in.
nano /etc/apt/source.list
Remove lines which is having docker repository.
Then do apt-get update

libmysqlclient.so.15: cannot open shared object file: No such file or directory

All Rails applications are working just fine until today. I am not sure if someone changes the settings on this machine. However does anyone know what could be the fix for this?
Details:
Centos 5.5
Apache
Passenger
Rails 3.0.x
MySql 5.0.77
Error details:
Okay this saves the day.
wget -O /usr/lib64/libmysqlclient.so.15 http://files.directadmin.com/services/es_5.0_64/libmysqlclient.so.15
chmod 755 /usr/lib64/libmysqlclient.so.15
ldconfig
You can try to find the right package by the following command:
$ sudo yum whatprovides libmysqlclient.so.15
libmysqlclient15-5.0.95-5.w5.i386
libmysqlclient15-devel-5.0.95-5.w5.i386
cpanel-mysql-libs-5.0.96-1.cp1136.i386 : The shared libraries required for MySQL clients
then:
$ sudo yum reinstall WHATEVER_THE_PACKAGE_NAME_IS
You may double check the package name by doing yum search package_name.
If not found, you may try to fix your yum repositories e.g. by configuring Webtatic Yum Repository.
To set up the repository, install the webtatic-release RPM:
Webtatic EL6 for CentOS/RHEL 6:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
Webtatic EL5.1 for CentOS/RHEL 5:
rpm -Uvh http://repo.webtatic.com/yum/el5/latest.rpm
Webtatic 5 for CentOS/RHEL 5:
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
and repeat the search/reinstall process again.
If you're running cPanel, you may try to run the following script:
/scripts/check_cpanel_rpms --fix
If won't help, remove the broken package e.g. rpm -e cpanel-mysql-5.0.96-1.cp1136 and run the check command again.
If still doesn't work, another thing could be to recompile your Apache (only if your LAMP is broken) by:
/scripts/easyapache

Resources