Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common commands for installing software in Docker

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains the "Docker installation software commonly used commands", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Docker installation software common commands" bar!

1. Docker installs MySQL1.1, pulls MySQL image docker pull mysql:latest1.2, creates MySQL container # does not specify local mapping file docker run-- name mysql01-p 3309MySQL 3306-e MYSQL_ROOT_PASSWORD=root-d mysql:latest# specifies local mapping file (host host needs to create folder in advance) docker run-- name mysql01-p 3309docker pull mysql:latest1.2 3306-e MYSQL_ROOT_PASSWORD=root-v / System/Volumes/Data/data/personal/docker/mysql/mysql01 : / var/lib/mysql-d mysql:latest1.3 start and stop MySQL Container # start start can be followed by container ID or container name What I use here is the name docker start mysql01# startup stop can be followed by a container ID or a container name, and I use the name docker stop mysql011.4 to access the MySQL database # 1. Use mysql-cli to visit mysql-cli-h 127.0.0.1-u root-p root# 2. Use mysql graphical interface tools such as Navicat or mysqlWorkbatch to connect: 127.0.0.1 port: 3306 user name: root password: root1.5 delete MySQL container # delete container, container ID can query docker rm container ID2 by command: `docker ps-a`. Docker install Redis2.1 pull Redis image docker pull redis:latest2.2 create Redis container docker run-d-name redis01-p 6379docker pull redis:latest2.2 6379 redis-- requirepass "password" 3. Docker install Nginx3.1 pull image docker pull nginx:latest3.2 startup container docker run-d-name nginx01-p 8080 Nginx3.1 80 nginx:latest# mount nginx.conf to host docker run-d-name nginx01-p 8080 80 v / data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf nginx:latest

After startup, the browser opens http://localhost:8080 to display Welcome to nginx! This proves that the nginx installation is successful.

3.3 Nginx related commands start nginx windows launch service nginx start linux/mac launch nginx-c filename specify a configuration file for nginx instead of the default. Nginx-c filename-p / path specifies the configuration file and log storage location for nginx nginx-s relaod restart nginx-s stop quickly close Nginx, may not save relevant information, and quickly terminate the web service. Nginx-s quit closes Nginx smoothly, saves relevant information, and ends the web service in a scheduled manner. Nginx-t does not run, just tests the configuration file. Nginx checks the syntax of the configuration file for correctness and attempts to open the file referenced in the configuration file. Nginx-v displays the version of nginx. Nginx-V displays the version of nginx, compiler version, and configuration parameters. 4. Docker installs RabbitMQ4.1 to find RabbitMQ image

Why does RabbitMQ increase the step of finding images? because Rabbit has an administrative background, we need to check some information about MQ in the administrative background, so the latest version is not suitable. We can find it on docker hub. I choose 3.8.7-management here.

4.2 pull image docker pull rabbitmq:3.8.7-management4.3 boot image # access http://localhost:15672 default username password is guest docker run-d-name rabbitmq01-p 5672guest docker run 5672-p 15672guest docker run 15672 rabbitmq:3.8.7-management # specify password to start docker run-d-- name rabbitmq01-p 5672guest docker run 5672-- hostname rabbitmq01-e RABBITMQ_DEFAULT_USER=admin-e RABBITMQ_DEFAULT_PASS=123456 rabbitmq:3. 8.7-management4.4 accesses RabbitMQ management backend

Open http://localhost:15672/ in the browser and enter the user name: admin, password: 123456.

5. Docker install CentOS5.1 pull image docker pull centos:latest5.2 start fixed ip centos container # create custom network docker network create-- subnet=172.18.0.0/16 mynetwork# launch fixed ip container docker run-itd-- privileged-- name centos1-- net mynetwork-- ip 172.18.0.11 centos:latest / usr/sbin/init6. Docker install ElasticSearch6.1 pull image docker pull elasticsearch:latest6.2 boot container docker run-- name elasticsearch-p 9200 docker pull elasticsearch:latest6.2 9200-p 9300 docker pull elasticsearch:latest6.2 9300-e "discovery.type=single-node"-d elasticsearch:latest6.3 test installation completed # 1. Enter curl http://localhost:9200# 2. Open the link http://localhost:9200 in the browser

If the following information is returned, the installation is successful.

{"name": "530dd7820315", "cluster_name": "docker-cluster", "cluster_uuid": "7O0fjpBJTkmn_axwmZX0RQ", "version": {"number": "7.2.0", "build_flavor": "default", "build_type": "docker", "build_hash": "508c38a", "build_date": "2019-06-20T15:54:18.811730Z" "build_snapshot": false, "lucene_version": "8.0.0", "minimum_wire_compatibility_version": "6.8.0", "minimum_index_compatibility_version": "6.0.0-beta1"}, "tagline": "You Know, for Search"} 6.4 modify configuration Solve cross-domain # enter docker exec-it elasticsearch/ bin/bashcd / usr/share/elasticsearch/config/vi elasticsearch.yml inside es container

Add the following at the end of the elasticsearch.yml file:

Http.cors.enabled: truehttp.cors.allow-origin: "*"

Restart the container after modifying the configuration, that is:

Docker restart elasticsearch6.5 install ik word Separator # enter es container internal docker exec-it elasticsearch/ bin/bashcd / usr/share/elasticsearch/plugins/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.2.0/elasticsearch-analysis-ik-7.2.0.zip# exit es container internal exit# restart esdocker restart elasticsearch

After the installation is complete, you can enter the following code in dev tools to verify after the following kibana installation is complete:

POST test/_analyze {"analyzer": "ik_max_word", "text": "Hello, I am Dongye Jiafly"}

Do not add "analyzer": "ik_max_word", then every word is participle. Remember to try it after the kibana installation is complete.

7. Docker install Kibana7.1 pull image docker pull kibana:latest7.2 boot container docker run-- name kibana-- link=elasticsearch:test-p 5601 docker pull kibana:latest7.2 5601-d kibana:latestdocker start kibana

After startup, you can open the browser and enter http://localhost:5601 to open the interface of kibana. By the way, you can try whether the above 6.5k-participle is installed successfully.

Appendix Docker Common commands function docker pull Image name: image version number pull Image docker images View Image docker ps View Image docker inspect Container ID View Container details including Port, IP and other docker network-l View Container Network

Thank you for your reading, the above is the content of "Docker installation software commonly used commands", after the study of this article, I believe you have a deeper understanding of the common commands of Docker installation software, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report