Directory
- About Ubuntu
- Set Ubuntu
- 1. After the installation is complete, update the updater via Apt-get
- 2. Remote connection using SSH
- About Docker
- Install Docker CE under Ubuntu
- Uninstalling older versions
- Add a package that uses HTTPS transport, etc.
- Add a GPG key for the Docker software source
- After the 8-bit verification key by searching the fingerprint
- Add Docker software Source to source.list (stable version)
- Installing the Docker CE
- Start Docker CE
- If you need to configure a proxy for Docker
- Set up a Docker user group
- Verify that Docker is installed correctly
- Reference
About Ubuntu
Ubuntu (Bantu) is a Debian-based Linux operating system for desktop applications, with the goal of providing a general user with the latest and most stable operating system, mainly free software.
Ubuntu Official website: http://www.ubuntu.com/
The version used here is: Ubuntu 16.04 LTS Desktop Edition
Set the UBUNTU1. Update updates via apt-get after installation is complete
The Advanced Packaging Tool (APT) is an installation package manager.
APT-related commands
sudo apt-get update //更新软件信息数据库sudo apt-get install xxx //安装xxx -d 仅下载 -f 强制安装sudo apt-get remove xxx //卸载xxxsudo apt-get upgrade //进行系统升级sudo apt-cache search //搜索软件包
Apt proxy settings
sudo touch /etc/apt/apt.conf //新建配置文件。sudo gedit /etc/apt/apt.conf //修改配置文件加入:Acquire::http::Proxy "http://proxyusr:[email protected]:proxyport";
It is recommended that you use the sudo apt-get Update command frequently to update your software information database, and you must do so every time you modify/etc/apt/sources.list.
2. Remote connection using SSH
Installing SSH Server
sudo apt-get install openssh-server
Turn on SSH login with root account
Ubuntu By default is not enabled root user and does not allow root login.
sudo passwd root //修改 root 密码 启用root账户sudo vi /etc/ssh/sshd_config //修改配置文件PermitRootLogin prohibit-password -> PermitRootLogin yessudo service ssh restart //重启ssh
View IP
ifconfig
Tools
This uses the Winscp+putty tool remote operating system.
PuTTY-a free SSH and Telnet Client tool
WinSCP-A free open source SFTP, SCP and FTP Client tool
About Docker
Docker is a package of Linux containers that provides an easy-to-use interface for containers. It is currently the most popular Linux container solution.
Docker will rely on the application and the program, packaged in a file. When you run this file, a virtual container is generated. The program runs in this virtual container as if it were running on a real physical machine. With Docker, you don't have to worry about environmental issues.
In general, the interface of Docker is quite simple, and users can easily create and use containers and put their own applications into containers. Containers can also be versioned, copied, shared, and modified, just like managing normal code.
Key Benefits of Docker:
- Faster than VM startup, low resource footprint, small size
- Consistent operating Environment
- Continuous delivery and deployment
- Easier to scale and migrate
Docker official website: https://www.docker.com/
Install Docker CE uninstall old version under Ubuntu
An older version of Docker is called Docker or docker-engine, uninstall the old version using the following command:
sudo apt-get remove docker docker-engine docker.io
Add a package that uses HTTPS transport, etc.
sudo apt-get updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common
Add a GPG key for the Docker software source
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - #如果使用代理请添加-x proxyaddress:proxyport
After the 8-bit verification key by searching the fingerprint
sudo apt-key fingerprint 0EBFCD88
Add Docker software Source to source.list (stable version)
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Installing the Docker CE
sudo apt-get updatesudo apt-get install docker-ce
Start Docker CE
sudo systemctl enable dockersudo systemctl start docker
If you need to configure a proxy for Docker
sudo mkdir -p /etc/systemd/system/docker.service.d //创建文件夹sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf //创建配置文件并添加下面两行[Service] Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"sudo systemctl daemon-reload //刷新变化sudo systemctl restart docker //重启Docker
Set up a Docker user group
By default, the Docker command communicates with the Docker engine using a Unix socket. Only users of the root user and Docker group can access the Unix sockets of the Docker engine. For security reasons, root users are not directly used on Linux systems. Therefore, it is a better practice to join users who need to use Docker in the Docker user group.
sudo groupadd docker //建立 docker 组sudo usermod -aG docker $USER //将当前用户加入 docker 组
Verify that Docker is installed correctly
docker run hello-world
Reference
- Docker official Ubuntu Installation documentation
- Docker official SYSTEMD Operation Docker Documentation
- Docker from getting started to practicing
- Docker Getting Started tutorial
- Set up an agent for apt under Ubuntu
- Ubuntu Common file Commands
Environment Ready Ubuntu & Docker