How to quickly deploy docker on ubuntu server

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

Install curl

sudo apt-get install curl

Install docker

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

Add non-root users to the docker group (here is ubuntu)

sudo usermod -aG docker ubuntu

Set daocloud acceleration

step1 Register an account on www.daocloud.io

step2 Click on the accelerator on the personal dashboard, and run the script code on the server (mosaic)

Copy the code code 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 take effect

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 in the current path to create a docker image
docker run -p 4000:80 friendlyname #Run friendlyname to map port 4000 to 80
docker run -d -p 4000:80 friendlyname   # Same thing, but in detached mode
docker ps         #Show running docker container
docker stop <hash>      #Stop making docker containers
docker ps -a   #Show all docker containers, including those that are not running
docker kill <hash>     #Forced to close the docker container
docker rm <hash>    #Remove the specified container from the machine
docker rm $(docker ps -a -q)   #Remove all containers from this machine
docker images -a        #Show all mirrors
docker rmi <imagename>   #Remove the specified image from the machine
docker rmi $(docker images -q)    #Remove all mirrors from this machine
docker login    #Log in to the docker CLI
docker tag <image> username/repository:tag #Tag the images uploaded to the warehouse
docker push username/repository:tag   #Upload the marked image to the warehouse
docker run username/repository:tag     #Run the mirror of the warehouse

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

How to quickly deploy docker on ubuntu server
How to deploy Django on Ubuntu 14.04
How to install Docker Compose on Ubuntu 18.04
How to install Bacula Server on Ubuntu 14.04
How to use Samba server on Ubuntu 16.04
How to install Zabbix on Ubuntu 16.04 Server
How to install Prometheus with Docker on Ubuntu 14.04
How to install Squid proxy server on Ubuntu 18.04
How to set up Shiny Server on Ubuntu 14.04
How to set static IP on Ubuntu 18.04 Server
How to set static IP on Ubuntu 18.04 Server
How to install and use Docker on Ubuntu 20.04
How to use Docker data volumes on Ubuntu 14.04
How to deploy Clojure web application on Ubuntu 14.04
How to run the parsing server on Ubuntu 14.04
How to install and use Docker on Ubuntu 16.04
How to set up a DNS server on Ubuntu 18.04
How to quickly install docker on Linux (Centos version)
How to open https on nginx server under Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to upgrade to PHP 7 on Ubuntu 14.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to secure Nginx on Ubuntu 14.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04