linux install jdk+docker+boot

Install JDK in Linux

  1. Add jdk8.0_161, I put it in the /data/jdk/dk8.0_161 directory
  2. Add in the /etc/profile file

JAVA_HOME=/data/jdk/jdk1.8.0_161

CLASSPATH=$JAVA_HOME/lib/

PATH=$PATH:$JAVA_HOME/bin

export PATH JAVA_HOME CLASSPATH

  1. Execute source /etc/profile
  2. Perform java -version verification

Install docker in Linux

Prerequisites

  1. The kernel version of the CentOS system is higher than 3.10
  2. CentOS version is 7 and above (64-bit)

Installation process

  1. Upload the rpm file to the linux machine (I put it in the /home/user directory)
  2. Execute the command yum install --y /home/user/docker*.rpm
  3. Execute the command systemctl start docker to start the container
  4. Execute the command systemctl status docker to view the status of the container

 

Linux write script to set boot up automatically

  1. Create a new test.service file under /etc/system/system
  2. The content of test.service is as follows

[Unit]

Description=test service

[Service]

ExecStart=/home/user/ljb/shell-script/test.sh #The directory where the startup script is located

[Install]

WantedBy=multi-user.target

 

  1. Execute systemctl list-unit-files | grep test.service to check whether the system service is recognized
  2. Execute the command systemctl start test.service to start the system service
  3. Execute the command systemctl enable test.service to set the service to start automatically after booting

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/sdkdeveloper/article/details/90237953