Report this

What is the reason for this report?

how to install a package inside a fresh centos image pulled inside a docker??

Posted on September 28, 2018

yum -y install package_name is not working…i just pulled centos image directly from docker hub and run it with following command: docker -i -t run centos it entered a new shell prompt …ls command is working properly but when i tries to install a package it is not working…can anyone help me??



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

I had a similar issue recently. I noticed that the containers were not able to do any DNS lookups so yum was failing to resolve the repos, to fix that I only had to restart docker:

systemctl restart docker

After the restart, it all started working as normal.

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.