udemy Docker starting with Linux commands-BE A FIRST PENGUIN AND GROW AS WHALE https://www.udemy.com/course/linuxdocker-be-a-first-penguin-and-grow-as-whale/learn/lecture/16684274#questions/12224904 Section 3-15
After installing CentOS
# yum -y install docker
When you do
Cannot find a valid baseurl for repo
I got an error. If you install CentOS as it is, you may not be able to use the yum command. At least that was the case with the CentOS 7.8.2003 I used.
Install Linux (CentOS7.8.2003) on VirtualBox on mac Performed all operations as root user
# yum -y install docker
Open the following.
# vi /etc/sysconfig/network-scripts/ifcfg-???
??? is
# cd /etc/sysconfig/network-scripts
# ls
Please check your directory and enter it. In my case, there were two, ifcfg-enp0s3 and ifcfg-enp0s8, but only ifcfg-enp0s3 is used.
Change the description of ONBOOT from "no" to "yes" at the opened destination, and describe the DNS settings.
ONBOOT=yes
DNS1=8.8.8.8
DNS2=8.8.4.4
After completing the settings, restart.
# systemctl restart network
If all else fails, try restarting Linux.
I will check the operation just in case. I tried to update it.
# yum update
It worked properly.
# yum -y install docker
I was able to download it safely.
If it still doesn't work as expected, there may be a problem with the baseurl.
# vi /etc/yum.repos.d/CentOS-Base.repo
initial state
Change all baseurls to the following description.
#baseurl=http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/7.8.2003/os/x86_64/
After editing
Please set with the URL of the version you are using. I am from the following site https://blog.77jp.net/linux-iso%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8-%E3%81%AE%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%82%B5%E3%82%A4%E3%83%88%E5%9B%BD%E5%86%85%E3%83%9F%E3%83%A9%E3%83%BC
http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/ Open My version ➡︎ os / ➡︎ x86_64 / And the opened URL is set to baseurl.
https://mebee.info/2020/03/21/post-7689/ https://qiita.com/ntkgcj/items/fd8588dcd65a42c34875