Write Dockerfile and upload DockerHub

Empty your cup so that it can be filled again. —— Bruce Lee

This paper introduces

  • P2 Build a production-level Linux system
  • P3 Learn Docker in half an hour
  • P4 Write Dockerfile and upload DockerHub
  • P5 Docker SpringCloud – compose deployment
  • P6 Build Harbor private server for enterprise mirror
  • P7 K8S & Rancher is coming! Theory & Preparation
  • P8 Rancher2.3 built K8S 1.16 cluster
  • P9 Deploy Spring Cloud to Kubernetes
  • P10 Deploy Vue to Kubernetes config ingress
  • P11 Ha01-rke install Kubernetes cluster
  • P12 HA02-Helm deploys the Rancher cluster

Install the docker – compose

To obtain resources, pay attention to the subscription number /usr/local/bin

cp docker-compose-Linux-x86_64 /usr/local/bin

mv /usr/local/bin/docker-compose-Linux-x86_64 /usr/local/bin/docker-compose   

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

Copy the code

The deployment of application

Git, Java, MVN, nginx
yum install -y git java maven nginx

# clone source
git clone https://gitee.com/log4j/pig.git  

# the root directory
cd pig

# compile source code
mvn clean install -Dmaven.test.skip=true 
Copy the code

The relevant operation

# build mirror
docker-compose build 

# start service
docker-compose up -d 

# stop service
docker-compose down --rmi all -v 

# check log
docker-compose logs -f
Copy the code

Related to Compose

Verify access

Visit nacos

Form a complete set of data

Please pay attention to wechat (Java-note), message: K8S for supporting information

Next article build enterprise mirror private server Harbor