Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 6.5.How to make a Docker image that can be logged in by ssh

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to make a Docker image that can be logged in to ssh by CentOS 6.5. the content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Docker uses Series 1 to change the image source to Aliyun's to facilitate subsequent operations.

Execute this command and change the source address to Ali's:

Curl https://git.oschina.net/feedao/Docker_shell/raw/start/ali-centos.sh | sh

First install Docker:

Yum-y install docker-io

Second, start Docker:

Service docker start

Third, install the tools for making CentOS images:

Yum-y install febootstrap

Fourth, make CentOS image file centos6-image directory

Febootstrap-I bash-I wget-I yum-I iputils-I iproute-I man-I vim-minimal-I openssh-server-I openssh-clients centos6 centos6-image http://mirrors.aliyun.com/centos/6/os/x86_64/

The fifth is to make a Docker image, which is named centos6-base.

Cd centos6-image & & tar-c. | docker import-centos6-base

The sixth is to make a Docker image that can be logged in by ssh, whose name is centos6-ssh.

Docker build-t centos6-ssh https://git.oschina.net/feedao/Docker_shell/raw/start/Dockerfile

After the first six steps, a local docker image that can be logged in is made.

The user name is root and the password is 123456

Experience steps:

Create a container:

Docker run-d-p 127.0.0.1 purl 33301purl 22 centos6-ssh

Ssh login container:

Ssh root@127.0.0.1-p 33301

After entering the password, you can start messing around.

About CentOS 6.5 how to make ssh login Docker image to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report