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

Docker Light-weight virtualization-for class1

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Docker [1] is a tool designed to make it easier to create, deploy, and run applications by using containers.

In this class, i will introduce the Virtual Maching used in Docker Class.

How to install the docker?

C. F Search "docker ce install centos7" on google.com

Centos 7 install docker

* * You can use this command to verify that your virtual machine has docker installed

Rpm-qa | grep docker

In this docker VM needed two network adapter, (1) NAT (2) Host-only

How to start the docker service?

Systemctl start docker

How to check the docker service?

Systemctl status docker

* * For this First Class**

We need to pull the docker image from docker hub after started the docker service in this VM, and change the user to root

Docker pull chusiang/takaojs1607

This command could need some time to get the docker images from the internet.

After when you fininshed, you can use this command to check the docker images in your VM

Docker images

In this command, you can see the Repository (Let's use this example)

(1) chusiang means the docker account

(2) takaojs1607 means the image name

And you can see that the IMAGED ID like 90ebc6376878

IMAGED ID can be only, and the containers ID can be many different.*

Let start docker!

Docker run-it chusiang/takojs1607 bash

-i means interactive

-t means terminal

Bash-> command

The basic command for first Class

Docker ps

It can check what the docker process run on this system

Ex: the container id is f0eba9cc4a7`docker stop containers ID

Ex: docker stop f0edocker ps-a

-a meanes all, you can see all the docker processdocker start containers ID

Ex: docker start f0edocker attach containers ID

Ex: docker attach f0edocker rm containers ID

You can use this command to remove this container!

But!! Not the docker images! docker rm-f $(docker ps-Q-a)

This command can kill the docker container by force whatever the docker process start or stop

-f means force

-a means all

Reference

[1] https://www.docker.com

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