Installing JDK, Git, and Docker on a Linux Host
Installing JDK
The following procedure uses jdk-8u144-linux-x64.tar.gz as an example to describe how to install JDK on a Linux host.
- Download the JDK from the official website and upload it to the Linux host.
- Run the following commands in sequence to decompress the source code package:
- Creating the java folder in /usr/local: sudo mkdir /usr/local/java
- Copying the downloaded package to java: cp jdk-8u144-linux-x64.tar.gz /usr/local/java
- Going to java: cd /usr/local/java
- Decompressing the package: sudo tar -xvf jdk-8u144-linux-x64.tar.gz
- Deleting the package: sudo rm jdk-8u144-linux-x64.tar.gz
- Set JDK environment variables.
Modify /etc/profile, which is an environment variable shared by all users.
- Run the sudo vim /etc/profile command to open the /etc/profile file.
- Add the following code segment to the end of the file:
export JAVA_HOME=/usr/local/java/jdk1.8.0_144 export JRE_HOME=/usr/local/java/jdk1.8.0_144/jre export CLASSPATH=.:$JAVA_HOME/LIB/DT.JAR:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$PATH
When adding the preceding code, pay attention to the following:
- Do not add spaces before or after an equal sign (=).
- Separate variables with colons (:), not semicolons (;).
- Press Esc, enter :wq!, and press Enter to save the modified file.
- Reload the /etc/profile file.
source /etc/profile
- Run the java -version command to check whether the installation is successful.
If the following information is displayed, installation is successful.

Installing Git
The following procedure uses git-1.8.3.1-23.el7_8.x86_64.rpm as an example to describe how to install Git on a Linux host.
- Download Git from the official website and upload it to the Linux host.
- Run the rpm -ivh git-1.8.3.1-23.el7_8.x86_64.rpm --nodeps command to decompress the source code package.
- Run the git --version command to check whether the installation is successful.
If the following information is displayed, installation is successful.

Installing Docker
The following procedure uses docker-19.03.15.tgz as an example to describe how to install Docker on a Linux host.
- Download Docker from the official website and upload it to the Linux host.
- Run the following commands in sequence to decompress the source code package:
- Decompressing the package: tar zxvf docker-19.03.15.tgz
- Moving the docker package to /usr/bin/: mv ./docker/* /usr/bin/
- Modify the configuration file as follows:
- Run the vim /usr/lib/systemd/system/docker.service command to open the docker.service file.
- Press I and copy the following content to the file:
[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. #TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process # restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
- Press Esc, enter :wq!, and press Enter to save the modified file.
- Run the following commands in sequence to restart Docker.
systemctl daemon-reload
systemctl enable docker.service
systemctl restart docker.service
- Run the docker -v command to check whether the installation is successful.
If the following information is displayed, installation is successful.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot