Recently done a project to create a Web project Docker mirror image, after some toss finally made out, here record, also hope that the reader can go a little detour! The following is the data collation!
Supplierprofile Project based on Java,mongodb,tomcat
Disable SELinux
VI Etc/selinux/config
Selinux=disabled
selinuxtype=targeted
Running Mirrors
Docker run-i--privileged=true-v/home/centos:/usr/local/file-d-P 80:8080--name SP1 Centos/bin/bash
Go to mirror
Docker exec-it 7bd1d90c7d98/bin/bash
To the file path
Cd/usr/local/file
Extract MongoDB Files
TAR-VXF mongodb-linux-x86_64-3.2.0.tgz
New service Path
Mkdir/usr/local/server
Moving MongoDB files
MV Mongodb-linux-x86_64-3.2.0/usr/local/server/mongodb
Creating MongoDB Data files
Mkdir/usr/local/mongodb
Mkdir/usr/local/mongodb/data
Touch/usr/local/mongodb/logs
Set up startup
echo "/usr/local/server/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data–logpath=/usr/local/mongodb/logs– Logappend--auth–port=27017 ">>/etc/rc.local
Start MongoDB
/usr/local/server/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--fork--logpath=/usr/local/mongodb/logs
[Success log] about
to fork the child process, waiting until server was ready for connections.
Forked process:40 Child
process started successfully, parent exiting
Decompression Tomcat
TAR-VXF apache-tomcat-8.0.30.tar.gz
Move Tomcat files
MV Apache-tomcat-8.0.30/usr/local/server/tomcat
Mobile Supplierprofile.war
CP supplierprofile.war/usr/local/server/tomcat/webapps/
Install Java
Yum Install Java-y
Start Tomcat
/usr/local/server/tomcat/bin/startup.sh
Host machine Browse URL, confirm success
Http://127.0.0.1/supplierprofile/profile.rpc
Generating Mirrors
Docker commit 7bd1d90c7d98 Itmaoo/sp
viewing mirrors
Docker images
Submit Mirror
Docker Push ITMAOO/SP
Thank you for reading, I hope to help you, thank you for your support for this site!