docker服务器环境部署

1.   环境部署

1.     安装和升级到JDK8

1.查看CentOS自带JDK是否已安装:yum list installed | grep java

2.假使存在自带的jdk,删除centos自带的JDK

   yum -y remove java-1.7.0-openjdk*

   yum -y remove tzdata-java.noarch

结果显示为Complete!表示卸载完成!

3. ll  (再次检查安装包是否删除)

4.查看yum库下的java安装包

    yum -y list java*(查看你想要的版本号)

5.以安装java-1.8.0为例         yum -y install java-1.8.0-openjdk*

等等!(看网速和脸的时候)

java -version(查看版本信息)

javac(查看java的编译器命令)

#配置PATH todo

cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/lib/

cd .

pwd

#获取安装java 安装目录

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/lib

vim /etc/profile

#添加如下内容

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

source /etc/profile

2.     安装maven

上传到/opt

cd /opt

tar xzvf apache-maven-3.5.2-bin.tar.gz

 

#将创建的目录apache-maven-3.5.2的bin目录添加到PATH环境变量中

 

vim /etc/profile

 

export PATH=/opt/apache-maven-3.5.2/bin:$PATH

source /etc/profile

在新的shell 中用mvn -v确认。

#修改国内仓库

cd /opt/apache-maven-3.5.2/conf/setting.xml

       

       

            alimaven

            aliyun maven

            http://maven.aliyun.com/nexus/content/groups/public/

            central

       

       

            central

            Maven Repository Switchboard

            http://repo1.maven.org/maven2/

            central

       

       

            repo2

            central

            Human Readable Name for this Mirror.

            http://repo2.maven.org/maven2/

       

       

            ibiblio

            central

            Human Readable Name for this Mirror.

            http://mirrors.ibiblio.org/pub/mirrors/maven2/

       

 

 

3.     安装docker

yum install -y docker-io

systemctl enable docker.service

systemctl start docker

 

4.   安装docker-compose (一行=多行docker命令组合)

写docker命令到docker-compose.file

执行命令 docker-compose up -d

1,打开https://github.com/search,搜索compose,到compose项目,点击红框中链接

2,复制粘贴下面红框中的两行

 

curl -L https://github.com/docker/compose/releases/download/1.20.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

 

docker-compose -v

成功显示版本信息,完成!!!

 


你可能感兴趣的:(docker)