Docker common commands, installation of common instances, one-step installation of MySQL

Source: Internet
Author: User
Tags zookeeper docker ps rabbitmq docker run

Just came to the company, with the company test Environment Project Server, the environment is Linux Centos7.2 all tomcat are mounted under the Docker container, so also learned some simple docker instructions (Learn what is docker before learning, and will be commonly used Linux instructions).

List some of the commonly used:

Docker one-step pull MySQL 5.7

$ docker run-d-e mysql_root_password=admin--name mysql-v/data/mysql/data:/var/lib/mysql-p 3306:3306 MYSQL

Default password admin If you want to change,--name for the instance name Mysql-v will/data/mysql/data host (that is, the CentOS path) reflected to the/var/lib/mysql under the 3306 port

Docker two-step installation zookeeper

Docker Pull Docker.io/jplock/zookeeper

Docker run-d--name zookeeper--publish 2181:2181 jplock/zookeeper:3.4.6

Like MySQL.

Docker one-step installation of Tomcat

Docker run--privileged=true-v/xxx:/usr/local/tomcat/webapps/root-p 8081:8080 tomcat:8

The port itself is defined, XXX is the running path of the project under the Linux host, that is, the project path of Tomcat under WebApps, reflected to the root

Docker one-step installation RABBITMQ

Docker run-d--name rabbitmq--publish 5671:5671--publish 5672:5672--publish 4369:4369--publish 25672:25672--publish 15671:15671--publish 15672:15672 rabbitmq:management

Note: If the port is turned on, the firewall must have a custom port open under the server, and the security group

Docker installation Redis

Docker run Redis--name redis-p 6379:6379-d redis-server

Docker installation Nginx

Docker Pull Nginx

Docker run-p : --name nginx-v $PWD/www:/www-v $PWD/logs:/wwwlogs-d nginx

Here are a few common instructions for Docker:

Docker ps-a View all containers

Docker exec-it Instance name/bin/bash into the instance, such as into Tomcat under Docker exec-it Tomcat/bin/bash

        If Tomcat is running slowly, you need to change the JDK session random into the instance after the CD $JAVA _home into JAVA path, cd/lib/security vim java.security

Change this to/dev/./urandom the reason why Tomcat is running slow

Docker inspect instance name gets all the data for the instance

       

Docker common commands, installation of common instances, one-step installation of MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.