1 环境
1 java
sudo apt-get update
sudo apt-get install openjdk-8-jdk
# 通过 /etc/environment 配置 废弃
#JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
#JRE_HOME=${JAVA_HOME}/jre
#CLASSPATH=.:JAVAHOME/lib:{JRE_HOME}/lib
#PATH=JAVAHOME/bin:PATH
# 通过 配置
sudo vi /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=${JAVA_HOME}/bin:${PATH}
# 使配置生效
source /etc/profile
2 maven
mvn -version
wget https://apache.website-solution.net/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz -P /home/gelin/software
sudo tar xf /home/gelin/software/apache-maven-*.tar.gz -C /home/gelin/software
sudo ln -s /home/gelin/software/apache-maven-3.8.1 /home/gelin/software/maven
# 修改配置文件
sudo vi /etc/profile
export M2_HOME=/home/gelin/software/maven
export PATH=${M2_HOME}/bin:${PATH}
source /etc/profile
# 1 更新 apt源索引
sudo apt-get update
# 2 安装包允许apt通过HTTPS使用仓库
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# 3 添加Docker官方GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 4 设置Docker稳定版仓库
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# 5 更新来源
sudo apt-get update
# 安装社区版
sudo apt-get install docker-ce
# 开机启用
sudo systemctl enable docker
# 检测是否安装正确
sudo docker run hello-world
sudo service docker start
sudo service docker stop
sudo service docker restart
3.1 开启2375 端口
vim /etc/default/docker
# 0.0.0.0表示任意IP的主机都可以访问
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
# 重启
sudo service docker restart
# 测试是否成功
netstat -tulp
网友评论