In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to start the centos container with macbook docker". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
After the download of centos image is completed in the previous article, how to start and access:
1. Use the following command to start the window.
Docker run-d-I-t / bin/bash
-d: starts in daemon mode.
-- name=' container name 'specifies the container name
-p port1:port2 maps the host's port1 port to the container's port2
-I: leave the standard input of the container open
-t: option for Docker to assign a pseudo terminal (pseudo-tty) and bind it to the standard input of the container
: here is centos. / bin/bash must be replaced.
Use-I-t to enter container command line mode directly
In addition, if you have multiple containers called centos, but the version number is not the same, then use: centos:7.0 method.
2. After startup, you enter the command line mode of the container. But I found that I didn't even install ifconfig.
3. Install ifconfig:
First, search for the available installation packages at: yum search ifconfig:
Yum search ifconfig
After the search is completed, it is found that ifconfig is under net-tools.x86_64, and you can install it:
Yum install net-tools.x86_64
At this point, you can check your IP.
After installation, be sure to save the image and start it later, otherwise you will have to install it again.
Save it by opening a new command line on the host and using:
Docker commit, such as:
Docker commit bigsnow/centos-ifconfig
But I have a problem here: you can't Ping with the host Ping IP, but you can Ping the Ping host in the container. It seems that it still needs to be configured.
This is the end of "how to start the centos container with macbook docker". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.