In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What is Docker-Compose?
The Compose project, which comes from the previous fig project, is written in python and is highly compatible with docker/swarm. Compose is a tool for orchestrating Docker containers, defining and running multi-container applications. You can start multiple containers with one command. Using Docker Compose, you no longer need to use shell scripts to start containers. Compose manages multiple Docker containers through a configuration file. In the configuration file, all containers are defined by services, and then use docker-compose scripts to start, stop and restart the application, and the services in the application and all dependent service containers. It is very suitable for scenarios where multiple containers are combined for development. The default template file for docker-compose is docker-compose.yml, where each service defined must be automatically built by specifying an image or a build instruction (which requires Dockerfile) through the image directive.
There are basically three steps to using Compose:
1. Define your application environment in Dockfile so that it can be replicated anywhere.
two。 Define the services that make up the application in docker-compose.yml so that they can run together in an isolated environment.
3. Finally, running dcoker-compose up,Compose starts and runs the entire application.
Let's take a look at the issues that the docker-compose deployment mysql cannot access.
This problem has perplexed me for a long time. After using docker-compose to deploy mysql, after carrying on the container, you can access it using mysql-u root-p, but you can't connect with sql client. So I found a lot of information on google, and I finally found that adding command:-- default-authentication-plugin=mysql_native_password can solve this problem, it still has something to do with password encryption.
Version: "3. 3" services: Redis: image: sameersbn/redis:latest ports:-"6379image 6379" volumes:-redis_data:/var/lib/redis restart: always mysql: image: mysql:latest restart: always command:-- default-authentication-plugin=mysql_native_password # this code solves the unreachable problem networks:-dev ports:-"3306 default-authentication-plugin=mysql_native_password:" environment: MYSQL_ROOT_PASSWORD: abc123 MYSQL_USER: 'test' MYSQL_PASS:' test' volumes:-mysql_data:/var/lib/mysqlnetworks: dev: driver: bridgevolumes: redis_data: mysql_data:
Summary
The above is the problem that the docker-compose deployment mysql cannot be accessed by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.