Installation jdk
Create a directory mkdir -p / usr / local / dockerjdk8 download the JDK -8u171-Linux-x64.tar.gz and uploaded to the server in / usr / local / dockerjdk8 create file vi Dockerfile Dockerfile # dependent image name and ID the FROM CentOS: 7 # specify image creator information the MAINTAINER on ITCAST # working directory switching the WORKDIR / usr the RUN mkdir / usr / local / java #add relative path jar, added to the vessel java the ADD-8u171 JDK-Linux-x64.tar.gz / usr / local / java / # java configuration environment variable ENV JAVA_HOME /usr/local/java/jdk1.8 .0_171 ENV JRE_HOME $ JAVA_HOME / jre ENV the CLASSPATH $ JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/ lib: $ the CLASSPATH ENV the PATH $ JAVA_HOME / bin: $ the PATH ------------- execute the command to build the mirror docker -t build = 'jdk1.8' . Note that spaces and points behind, do not omit to view mirror whether to establish a complete Docker ImagesRF Royalty Free Docker RUN -it --name = myjdk8 jdk1.8 / bin / bash
- Start Docker Docker - View Docker ImagesRF Royalty Free - start systemctl Start Docker - Create a database container MySQL Docker RUN -DI --name = tensquare_mysql -p 3306: 3306 = -e MYSQL_ROOT_PASSWORD root CentOS / MySQL-57- centos7 - Creating mongodb container Docker RUN -DI --name = tensquare_mongo -p 27017: 27017 mongo - Docker Starter start Docker PS - Check container Docker PS -n 5 - Close Docker STOP - start Docker start - RabbitMQ Docker RUN-di --name=tensquare_rabbitmq -p 5671:5617 -p 5672:5672 -p 4369:4369 -p 15671:15671 -p 15672:15672 -p 25672:25672 rabbitmq:management -- gogs docker run -d --name=gogs -p 10022:22 -p 3000:3000 -v /var/gogsdata:/datagogs/gogs
Configuration jdk