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

How to make a Docker image that can be logged in with ssh by CentOS6.5

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

Share

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

This article mainly shows you "CentOS6.5 how to create a Docker image that can be logged in by ssh", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "CentOS6.5 how to make a Docker image that can be logged in by ssh".

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.

The above is all the contents of the article "how CentOS6.5 makes Docker images that can be logged in by ssh". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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