Environment Dependent Installation

Linux installation (Ubuntu18.04 WSL)

One-click scripting setup: Let’s start with the home directory!

Go environment:

Sudo wget -p CD/usr/local/usr/local https://studygolang.com/dl/golang/go1.15.linux-amd64.tar.gz sudo tar ZXVF. - Go1.15. Linux - amd64. Tar. GzCopy the code

Where the command line content of go1.15. Linux-amd64 can replace the newer version, go to the website to search.

Add environment variables for future use.

# vim ~/. Bashrc # vim ~/. Export GOROOT=/usr/local/go export GOPATH=~/go # Export GOBIN=$GOPATH/bin export PATH=$PATH:$GOROOT/bin:$GOBINCopy the code

Updating environment variables

Source /etc/profile # source ~/.bashrc # Update the current user's environment variablesCopy the code

Verify that go is successfully installed.

The docker environment

One click to install docker script, (domestic acceleration). The latest version of Docker is installed by default

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

Check whether the installation is successful.

Configure domestic image acceleration, so that we download images faster. If the etc directory does not have a Docker folder, create one by yourself.

# mkdir -p /etc/docker
sudo vim /etc/docker/daemon.json
Copy the code

Because docker must add sudo permission by default, we add ordinary users to the management group. If the first does not work, use the second.

  1. groups $USER | grep docker
  2. sudo usermod -aG docker $USER

The configuration takes effect only after you log out of the current user. WSL users need to close the current terminal and then open it for it to take effect. If not, restart the Docker service.

Copy the following accelerated image to a file.

{
	"registry-mirrors": [
		"https://registry.docker-cn.com",
		"http://hub-mirror.c.163.com",
		"https://docker.mirrors.ustc.edu.cn"
	]
}
Copy the code

Restart the Docker service.

sudo service docker restart
Copy the code

Test whether the installation is successful. And it worked!

docker run hello-world
Copy the code

Docker-compose environment installation

One-click script installation (Domestic script acceleration)

In the command line, 1.12.0 is the version number. You can view the version on the official website and download the new version.

The curl -l https://get.daocloud.io/docker/compose/releases/download/1.12.0/docker-compose- ` ` uname - s - ` uname -m ` > ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-composeCopy the code

Check whether the installation is successful? The following figure shows the command output. Success again!

The pre-installation environment is basically done, if the NVM node installation is involved later. There will also be scripts for installation. You might as well relax now.