Docker deployment mysql, tomcat notes

Docker notes finishing

# , Environmental: Ubuntu 18. *

# Install 5.6 MySQL , Tomcat

 

#、docker search mysql

报错:Error response from daemon: Get https://index.docker.io/v1/search?q=openjdk&n=25: dial tcp: looku

Solution: Modify the machine DNS

Vi /etc/resolv.conf $   # editorial changes to 114.114.114.114

/Etc/init.d/networking restart $   # to restart the network card

 

# Install mysql 5.6

$ docker push centos/mysql-56-centos7

$ docker run --name mysql-macrobot_admin -e MYSQL_ROOT_PASSWORD=G84Kd_n3L51Gh*n2D{v -d -p 4001:3306 centos/mysql-56-centos7

$ docker start mysql-macrobot_admin

 

# If you pull slow download speeds, you can switch accelerator (Ali) 

 

# Installation tomcat

$ docker run -d --name tomcat --link  mysql-macrobot_admin -v /home/macrobot/project:/data -p 80:8080 tomcat

# -Link link guide (directly with the database instance within the network),

# -V mount (shared), the machine is mounted to the directory * instance / data directory

80 # -p port mapping example of the present machine to port 8080

 

#, Enter docker examples

$ docker exec -it 7f28dd6b0fbb /bin/bash

 

 

Guess you like

Origin www.cnblogs.com/loongsoft/p/11367206.html
Recommended