Installation: Looks like only 64-bit support
sudo apt-get install Docker
sudo apt-get install Docker.io
sudo apt-get install Docker-registry
Command:
Create a system container and connect remotely1. Terminal command Docker pull rastasheep/ubuntu-sshd, download with SSH service to the system image;2. Start Container Docker run-itd-p16888: A-H jason_sshd_test--name="docker_001"rastasheep/ubuntu-sshd Bash;3. container Docker Exec-it docker_001 bash;4. Modify the Ubuntu password to passwd;5the container has been modified to save the pre-image. Docker Stop docker_001 stop container to do; Docker commit docker_001 DOCKER_V1, submit image;6. Docker EXEC again-it docker_001 bash into the container;7. Restart the container SSH service, inside the container console output service SSH restart;8. docker external Terminal output command SSH [email protected]127.0.0.1-p 16888 Remote connection, complete. Create a simple Web container1Find Nginx Image Docker search Nginx on the Docker hub; 2. Pull the image of the official, Docker pulls Nginx; 3. Mirroring the shipping container Docker run-p the: the-d nginx? Command description:-P the: the: Map The 80 end of the container to the end of the host?--name Mynginx: Name the container Mynginx4. Command Docker exec Mynginx bash into the container;5. Command nginx inside the container;6Outside the container, view the container boot situation via browser http://127.0.0.1:80 orCurl accesses Curl ' http://127.0.0.1:80 '. dockerfile introduction and make? (Build Nginx container via Dockerfile)1. Create a nginx,mkdir-p ~/nginx/www ~/nginx/logs ~/nginx/conf;2. Create dockerfile;3. Build the image so that the. Command Docker Build-t Mynginx.;4. To view the image, make the command Docker images Mynginx, complete.
You need root permission to run Docker, you can do this
sudo groupadd docker #添加docker用户组
sudo gpasswd-a $USER Docker #将登陆用户加入到docker用户组中
Newgrp Docker #更新用户组
Docker PS #测试docker命令是否可以使用sudo正常使用
Linux-ububtu64-bit installation docker