LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 03-17-2020, 12:10 AM   #1
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Rep: Reputation: Disabled
Unable to update inside the Container


Hi Team,

Please be informed that, I have installed CentOS 8 in my VMWare workstation.

After that I have installed the docker-ce without any issues.

Later i have pulled the httpd image.

Code:
docker container run --publish 8080:80 --detach httpd
Now entering inside the container and trying to update the same.

Code:
docker container exec -it 7d7 bash
Code:
root@7d73e397628d:/usr/local/apache2# apt update
When i execute the above command and getting the attached error. Please help me how to resolve this.

Note:
I have tried the same in Ubuntu which I have installed in same VMWare, but i did not face any issues.

Please help me to solve the issue.
Attached Thumbnails
Click image for larger version

Name:	error.PNG
Views:	72
Size:	26.2 KB
ID:	32796  
 
Old 03-17-2020, 02:41 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Name resolution is not set up correctly in the container.

Check /etc/resolv.conf and fix it so that it points to a nameserver to which you have connectivity. For details, read Red Hat documentation.

EDIT: Oops, I misunderstood you. The container can't be running Centos, so disregard the documentation link. You need to follow instructions for the distro that runs in the container. Or perhaps the container is not supposed to be updated. Perhaps you should also read documentation pertaining to this particular container.

Last edited by berndbausch; 03-17-2020 at 02:43 AM.
 
Old 03-17-2020, 02:59 AM   #3
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi,

Could you please advise why the container can't be running in CentOS?
I have installed docker and pulled the httpd image in CentOS
Moreover I have tried the same in GCP cloud and it is working as expected.

My doubt is, do we need to change anything in the VMWare end or in the OS end?
 
Old 03-17-2020, 04:02 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I did not say that the container can't run in Centos.
I said that it can't be running Centos, since Centos doesn't use apt, and doesn't name the web server "apache2".
I also said that the name resolution in this container doesn't work. This is where you should start your troubleshooting.
 
Old 03-17-2020, 05:58 PM   #5
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi,

You have taken the question other way around.

The base OS is CentOS 8 and i have installed in VMWare.

I have pulled the docker container image httpd.

The docker container image OS is Debian.

So i have used apt.

I ran the above commands in GCP it works as expected but not in VMWare.

To fix the issue i need help.
 
Old 03-17-2020, 11:32 PM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The name resolution doesn't work. Which DNS server is configured in the container?

It may work in GCP because the container gets the correct nameserver from DHCP. The problem in your VMware environment may be due to an incorrect or no DNS server sent by DHCP.

The nameserver is defined in /etc/resolv.conf or recently /etc/systemd/systemd-resoled.conf (from memory).
 
Old 03-19-2020, 02:59 AM   #7
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi,

Sorry for the late reply.

I am not able to find the /etc/systemd/systemd-resoled.conf

Please find the below details from /etc/resolv.conf file

Code:
root@2e46bc93dfaf:/etc/systemd# cat /etc/resolv.conf
# Generated by NetworkManager
search server.com
nameserver 192.168.221.2
root@2e46bc93dfaf:/etc/systemd#
Please find the OS details of the container.

Code:
root@2e46bc93dfaf:/etc/systemd# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@2e46bc93dfaf:/etc/systemd#

Please note, I have installed Ubuntu variant and tried to do the same, it is working as expected.
The OS details of the container and resolv.conf file are same.

The only different is the base OS is Ubuntu instead of CentOS in VMWare.

I'm facing the same issue in real time as we are using the Linux OS in VMWare.
 
Old 03-19-2020, 06:04 AM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
From what you say, it seems that 192.168.221.2 is correct. Perhaps the container has no connectivity to this address?

It's your job to find out why name resolution fails. The DNS server doesn't resolve deb.debian.org, or it doesn't exist, or it is not accessible, or perhaps there are other reasons.

Perhaps name resolution works now and it did not work for a limited time.

Last edited by berndbausch; 03-19-2020 at 06:07 AM.
 
Old 03-19-2020, 07:44 AM   #9
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
It's your job to find out why name resolution fails
Actually im new to Dockers and containers and facing the issue.
I tied my best to find the resolution but nothing works, that's why i requested help here.
 
Old 03-19-2020, 07:58 AM   #10
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I don't know if it has anything to do with Docker. First rule out that it is a network problem independent of Docker:

Is there basic connectivity to the nameserver?
Do programs like nslookup resolve the name using the nameserver?
Are you successful with a different nameserver?
 
Old 03-19-2020, 08:47 AM   #11
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi,

Code:
[docker@dockernongui ~]$ cat /etc/resolv.conf
# Generated by NetworkManager
search server.com
nameserver 192.168.221.2
[docker@dockernongui ~]$
Here the 192.168.221.2 is the gateway of my Windows OS.

Code:
[docker@dockernongui ~]$ nslookup 192.168.221.2
** server can't find 2.221.168.192.in-addr.arpa: NXDOMAIN

[docker@dockernongui ~]$
Please find the below ip address from my Windows OS.

Quote:
Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.221.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
but i can ping the 192.168.221.2

Code:
[docker@dockernongui ~]$ ping 192.168.221.2
PING 192.168.221.2 (192.168.221.2) 56(84) bytes of data.
64 bytes from 192.168.221.2: icmp_seq=1 ttl=128 time=0.600 ms
64 bytes from 192.168.221.2: icmp_seq=2 ttl=128 time=0.425 ms
64 bytes from 192.168.221.2: icmp_seq=3 ttl=128 time=0.369 ms
^C
--- 192.168.221.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 54ms
rtt min/avg/max/mdev = 0.369/0.464/0.600/0.101 ms
[docker@dockernongui ~]$
 
Old 03-19-2020, 09:09 AM   #12
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Can you resolve deb.debian.org using this nameserver?
- from within the container
- from the Centos VM that runs the container
- from the Windows host that runs the Centos VM
?
 
Old 03-19-2020, 09:12 AM   #13
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by berndbausch View Post
I don't know if it has anything to do with Docker. First rule out that it is a network problem independent of Docker:

Is there basic connectivity to the nameserver?
Do programs like nslookup resolve the name using the nameserver?
Are you successful with a different nameserver?
You have confirmed that there is basic connectivity. Not yet the two other questions.
 
Old 03-19-2020, 09:22 AM   #14
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
As i said earlier, i have tried all the possible ways to resolve the deb.debian.org error.
I have updated the /etc/resolv.conf by entering "namesever 8.8.8.8" and "nameserver 192.168.221.1", but nothing works.

My laptop is running on Windows 8.1
I have installed VMWare 14 version and installed CentOS 8
In CentOS i have installed the docker and container for my learning.

Code:
[docker@dockernongui ~]$ curl deb.debian.org
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
   <TITLE>Welcome to deb.debian.org (fastly instance)!</TITLE>
</HEAD>
<BODY>

<H1>Welcome to deb.debian.org (fastly instance)!</H1>

Quote:
Are you successful with a different nameserver?
No, i can't.
 
Old 03-20-2020, 02:10 AM   #15
venugosr
LQ Newbie
 
Registered: Apr 2015
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi,

Could someone please help me how to set the Windows IP Address in Linux as i am using VMWare.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux container host os and container os question jzoudavy Linux - Newbie 1 09-01-2015 05:21 AM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
[SOLVED] Outputting X display from inside an LXC Container charlie101 Linux - Virtualization and Cloud 1 02-04-2013 09:41 PM
Slackware network scripts inside OpenVZ container yenn Slackware 2 08-21-2012 04:19 PM
QEMU / DosEMU inside OpenVZ container kirtimaan_bkn Linux - Virtualization and Cloud 2 11-09-2010 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration