首先咱們瞭解什麼是Dockerhtml
# 若是有結果出來,則說明自帶了java
java -version
# 查詢出已經安裝的java
rpm -qa|grep java
yum -y remove [刪除上面查出來的東西,多個用空格分隔]
複製代碼
cd /usr
mkdir /usr/java
rpm -ivh jdk-8u65-linux-x64.rpm
複製代碼
#編輯/etc/profile文件
vim /etc/profile
# 設置java環境變量
export JAVA_HOME=/usr/java/jdk1.8.0_211-amd64 # 根據狀況修改
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#使profile文件環境變量生效
source /etc/profile
複製代碼
java -version
複製代碼
# 執行如下命令
tar -zxvf apache-maven-3.6.1-bin.tar.gz -C /data/opt
# 在/etc/profile文件末尾增長如下配置
# 設置Maven環境變量
export MAVEN_HOME=/data/opt/apache-maven-3.6.1/
export PATH=$MAVEN_HOME/bin:$PATH
# 重載/etc/profile這個文件
source /etc/profile
複製代碼
mvn -v
複製代碼
<localRepository>/data/maven/repo</localRepository>
複製代碼
<!--私服帳號配置-->
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>3rdParty</id>
<username>admin</username>
<password>admin123</password>
</server>
<!--私服地址配置-->
<mirror>
<id>nexus</id>
<name>local nexus</name>
<url>http://172.31.116.12:9190/repository/maven-public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
複製代碼
安裝依賴
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker
若是已經安裝了git,可是版本太老,能夠先卸載
yum remove git
下載git包解壓
tar -vxf git-2.15.1.tar.gz -C /opt
進入git 目錄
cd /opt/git-2.18.0/
執行如下命令
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile //配置環境變量
source /etc/profile //跟新配置文件
git --version 查看git版本
複製代碼
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
複製代碼
# 安裝所需的包。 yum-utils提供yum-config-manager實用程序,devicemapper存儲驅動程序須要device-mapper-persistent-data和lvm2。
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
# 使用如下命令設置穩定版本(stable)存儲庫。
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
複製代碼
# 安裝wget 網絡工具
yum -y install wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release #阿里雲上的epel源
複製代碼
yum install docker-ce docker-ce-cli containerd.io
複製代碼
yum list docker-ce --showduplicates | sort -r
複製代碼
# 官方方法
yum install docker-ce-17.03.1 docker-ce-cli-17.03.1 containerd.io
複製代碼
# 直接安裝
yum install docker-ce-17.09.1.ce-1.el7.centos
# 或者安裝其餘版本
yum install docker-ce-18.09.6
複製代碼
systemctl start docker
複製代碼
docker pull library/hello-world
複製代碼
docker run hello-world
複製代碼
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
複製代碼