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

How to install common components in Docker

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about how to install common components in Docker. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

Docker install mysql

Docker search mysql search for docker pull mysql:5.6 download docker images | grep mysql view docker run-p 3306 grep mysql-- name mysql_docker-v $PWD/conf:/etc/mysql/conf.d-v $PWD/logs:/logs-v $PWD/data:/var/lib/mysql-e MYSQL_ROOT_PASSWORD=123456-d mysql:5.6 run command instructions:-p 3306: map port 3306 of the container to port 3306 of the host. -v-v $PWD/conf:/etc/mysql/conf.d: Mount the conf/my.cnf under the current directory of the host to the / etc/mysql/my.cnf of the container. -v $PWD/logs:/logs: Mount the logs directory under the current directory of the host to the / logs of the container. -v $PWD/data:/var/lib/mysql: Mount the data directory under the current directory of the host to the / var/lib/mysql of the container. -e MYSQL_ROOT_PASSWORD=123456: initializes the password of the root user. Docker ps View the running of the image and enter the container to initialize # mysql-u root-p # create database note

Docker install redis

Docker search redis search docker pull redis:3.2 download docker images redis view docker run-p 6379docker run-v $PWD/data:/data-d redis:3.2 redis-server-- appendonly yes run command description:-p 6379docker run 6379: map container port 6379 to host port 6379-v $PWD/data:/data: mount the data in the current directory in the host to the container / dataredis-server-- appendonly yes: execute the redis-server startup command in the container And open the redis persistent configuration docker ps to check the operation of the above is how to install common components in the Docker shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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

Servers

Wechat

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

12
Report