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

Docker installation Database tutorial

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces the relevant knowledge of "Docker Installation Database Tutorial". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Docker learning 1, Docker installation Mysql1, Docker search mysql ##Find out which versions of MySQL are available 2. Docker pull MySQL:5.6 ##Download mysql image version 5.6 3, docker run -p 3306:3306 --name mysql ##Run Image Generation Container -v /opt/myfile/mysql/conf:/etc/mysql/conf.d -v /opt/myfile/mysql/logs:/logs -v /opt/myfile/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=admin123 ##Password -d mysql:5.6 ##background silent operation ======================================================================= docker exec -it mysql /bin/bash ##Enter container 6, mysql -uroot -p ##7、docker exec mysql sh -c ' exec mysqldump --all-databases -uroot -p"admin123" ' > /opt/myfile/mysql/all-database.sql ##Backup database data II. Docker install Redis1. Docker pull redis:3.2 ##Download Redis 3.2 image 2, docker run -it -p 6379:6379 --name redis -v /opt/myfile/redis/data:/data -v /opt/myfile/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf -d redis:3.2 redis-server /usr/local/etc/redis/redis.conf --appendonly yes ##Run redis image generation container ======================================================================= ##Run redis-cli5. Operate redis6. Check whether persistent files are generated in/opt/myfile/redis/data 10. Docker local image is pushed to Alibaba Cloud 1. Generate image 1) DockerFile ##The first way: generate your own local image 2)、docker commit -a lee -m "new mycentos 1.4 from 1.3" c167ee237b87 mycentos:1.4 ##Second way: Create a new mirror from the container (-a Author of submitted image-m Text description when submitting)(docker commit [options] Container ID [REPOSITORY[:TAG]]) 2. Push local image to Alibaba Cloud 1) Alibaba Cloud Developer Platform-> Container Mirrors-> Mirror List-> Mirror Repository List 2) Create mirror repository->(namespace, repository name, abstract, description information, etc.) 3) Push the image to Registrydocker login --username=xxxxxxx registry.cn-beijing.aliyuncs.comdocker tag [ImageId] registry.cn-beijing.aliyuncs.com/xxxx/docker_warehouse:[Image version number]3. Pull the image docker pull registry.cn-beijing.aliyuncs.com/xxxxx/docker_warehouse:[Image version number] The content of Docker Installation Database Tutorial is introduced here. Thank you for reading it. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

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