One, docker into the pit (win10 and Ubuntu installation)

Preface

After all, I still can’t get around. There is really too much knowledge to learn. Fortunately, we still have time. I only heard the sound of docker before and never really contacted it. Now docker is getting more and more popular, and many companies have started. used. So for us programmers, we have to practice another necessary skill. So let us take the first step courageously, and let us learn from each other step by step. Let's start with the installation.

windows10 installation#

Reference: https://yeasy.gitbooks.io/docker_practice/content/install/windows.html

Turn on Hyper-V

Win10 installation requires Hyper-V to be turned on first. Control Panel-->All Control Panel Items-->Programs and Features-->Enable or Disable Windows Features

Download and install##

Then download the installer: Stable or Edge

After downloading, directly double-click the screenshot after running.

Click close and log out to restart the computer.

Settings##

After restarting the computer, there will be a docker icon in our navigation bar. Click the icon, select setting, genneral, and check the last option.

Set the mirror, we use the domestic mirror, which will increase the download speed, and set it in the setting daemon

https://registry.docker-cn.com
https://dockerhub.azk8s.cn

test##

View the docker version in the cmd console

docker version

Run the hello-world image

docker run hello-world

It proves that docker is successfully installed on win 10. As for how to use it next, we will talk about it in the next article.

Ubuntu installation#

Mine is Ubuntu 18.0.4, the installation method is also very simple.

# Uninstall old version
sudo apt-get remove docker docker-engine docker.io

# Install package update
sudo apt-get update

# Installation dependencies
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

# Add Docker official GPG key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Set up a stable Docker repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# Install docker-ce
sudo apt-get install docker-ce

View the installed docker version

docker version

Run hello-world

docker run hello-world

Found that the following error did not appear

The docker process uses Unix Socket instead of TCP port. By default, the Unix socket belongs to the root user and requires root privileges to access it. So use

sudo docker run hello-world

Or add the current user to the docker user group. By default, the docker command uses Unix socket to communicate with the Docker engine. Only the root user and users in the docker group can access the Unix socket of the Docker engine. For security reasons, root users are not directly used on Linux systems. Therefore, it is better to add users who need to use docker to the docker user group.

# Create a docker group:
sudo groupadd docker

# Add the current user to the docker group:
sudo usermod -aG docker $USER

# Update user group
newgrp docker

# Test whether the docker command can be used normally with sudo
docker ps

Fanwai#

So far, our win10 environment and ubuntu environment have already built docker. In the next part, let us continue to learn how to use docker.

Okay, just say so much

Recommended Posts

One, docker into the pit (win10 and Ubuntu installation)
Installation and use of Win10 subsystem Ubuntu
Ubuntu introduction and installation
Ubuntu16.04 installation and simple configuration
Ubuntu PostgreSQL installation and configuration
The difference between CentOS and Ubuntu
Install and configure Docker in Ubuntu
Redis installation under ubuntu and windows
Ubuntu 19.1 installation and configuration Chinese environment
Installation of Docker CE under Ubuntu
Ubuntu basic settings: introduction to the installation and use of openssh-server
Configuration and beautification after Ubuntu installation (1)
Nginx installation and configuration load (ubuntu12.04)
Ubuntu18.04 installation Anaconda3 and VSCode guide
Ubuntu configuration source and installation software
Docker CE for Ubuntu installation notes
Ubuntu installation and deployment Redash operation notes (2020.08)
Ubuntu18.04 system installation and prerequisite software installation guide
[Daily] Win10 open and install ubuntu subsystem
Installation and uninstallation of CUDA under Ubuntu 16.04
Ubuntu18.04 Server version installation and use (graphic)
Installation and deployment of Nginx in Ubuntu
n1. Docker installation and operation exceptions encountered
Ubuntu 14.04 16.04 Linux nvidia driver download and installation
Linux install Docker and run Ubuntu system
DLNA/UPnP Server installation and configuration under Ubuntu 12.04
Docker those things in the Ubuntu environment
Debian and Ubuntu installation source configuration file description
Installation of pulseaudio and API usage under Ubuntu 12.04
The basic configuration and interface beautification of Ubuntu
How to install and use Docker on Ubuntu 20.04
Virtual machine installation and configuration ubuntu shared folder_
How to open the ubuntu system in win10
Win10 install Linux ubuntu-18.04 dual system (installation guide)
Kaldi installation and configuration graphic tutorials under Ubuntu
Basic configuration and common software installation after ubuntu 18.04 installation
Turn off and turn on the firewall in ubuntu
Installation, configuration and uninstallation of GitLab in Ubuntu19.1
Technical corner | Windows 10/7 and Ubuntu 18.04 dual system installation
Installation and use of SSH in Ubuntu environment
How to install and use Docker on Ubuntu 16.04