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

The method of rapidly deploying docker on ubuntu Server

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

Share

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

Recently I was learning about docker, and today I learned about the rapid deployment of docker on a ubuntu server, so add a little note today.

Install curl

Sudo apt-get install curl

Install docker

Curl-sSL https://get.daocloud.io/docker | sh

Add non-root users to docker group (in this case, ubuntu)

Sudo usermod-aG docker ubuntu

Set up daocloud acceleration

Step1 registers an account on www.daocloud.io

Step2 clicks the Accelerator on the personal dashboard and runs the script code on the server (already mosaic)

The copy code is as follows:

Curl-sSL https://get.daocloud.io/daotools/set_mirror.sh | sh-s http://******.m.daocloud.io

Step3 restart docker to make the configuration effective

Sudo service docker restart

Verify that the docker installation is successful

Sudo docker run hello-world

Docker related commands

Docker build-t friendlyname. # use the Dockerfile under the current path to create a docker image docker run-p 4000 friendlyname 80 friendlyname # run friendlyname to map port 4000 to 80docker run-d-p 4000 friendlyname 80 friendlyname # Same thing, but in detached modedocker ps # shows the running docker container docker stop # stop making docker container docker ps-a # display all docker containers Contains docker kill # that does not run force closes the custom docker container docker rm # removes the custom container docker rm $(docker ps-a-Q) # removes all containers docker images-a # displays all mirrors docker rmi # removes the custom image docker rmi $(docker images-Q) # removes all images from the native docker login # Log in to docker CLIdocker tag username/repository:tag # to tag the image uploaded to the repository docker push username/repository:tag # upload the tagged image to the warehouse docker run username/repository:tag # run the warehouse image

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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