spring cloud linux服务器docker部署
1、首先安装jdk,
yum -y list java*
yum install java
2、安装maven:
maven下载地址:https://maven.apache.org/download.cgi
下载:
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven
mvn -version验证。如果出现问题查看jdk是否安装成功。
3、安装git
yum install git-core
4、安装docker
yum -y install docker-io
启动docker:service docker start
开机启动:sudo systemctl enable docker
5、安装docker-compose
docker-compose官网安装教程:https://docs.docker.com/compose/install/#install-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
该安装的已经安装完了,接下来就是运行我们的项目了:
1、首先git clone 项目
2、进入相应目录打包:mvn clean package docker:build
3、在有docker-compose.yml的目录下执行:docker-compose up -d