admin管理员组文章数量:1025490
The essence of the problem:
I'm trying to make sure that my container with all services starts when Windows starts, but despite the fact that restart is everywhere: only phpmyadmin always starts when the system starts, while mysql and xampp just don't start for some reason (Docker Desktop logs are empty, there are no errors). If you run the container manually, then everything works like clockwork.
Clarifying information:
- OS - Windows
- I use WSL 2
- The project files are located in the file system of the ubuntu subsystem at the path /home
- Download and build a project from the ubuntu operating system using
docker compose up
anddocker-compose up --build
docker-compose.yml:
version: "3.9"
services:
php-app:
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
- ./src:/var/www/html
- ./apache/php.ini:/usr/local/etc/php/php.ini
depends_on:
- database-container
ports:
- 3000:80
database-container:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: mysql_pass
MYSQL_USER: test_user
MYSQL_DATABASE: mysql_db
MYSQL_PASSWORD: user_pass
volumes:
- ./mysql/myf:/etc/myf
- ./mysql/data:/var/lib/mysql:rw"
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin:latest
restart: always
depends_on:
- database-container
links:
- database-container
ports:
- "3001:80"
environment:
PMA_HOST: database-container
MYSQL_ROOT_PASSWORD: mysql_pass
I realized that the problem is mounting docker volumes, but I can't figure out how to fix it.
The essence of the problem:
I'm trying to make sure that my container with all services starts when Windows starts, but despite the fact that restart is everywhere: only phpmyadmin always starts when the system starts, while mysql and xampp just don't start for some reason (Docker Desktop logs are empty, there are no errors). If you run the container manually, then everything works like clockwork.
Clarifying information:
- OS - Windows
- I use WSL 2
- The project files are located in the file system of the ubuntu subsystem at the path /home
- Download and build a project from the ubuntu operating system using
docker compose up
anddocker-compose up --build
docker-compose.yml:
version: "3.9"
services:
php-app:
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
- ./src:/var/www/html
- ./apache/php.ini:/usr/local/etc/php/php.ini
depends_on:
- database-container
ports:
- 3000:80
database-container:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: mysql_pass
MYSQL_USER: test_user
MYSQL_DATABASE: mysql_db
MYSQL_PASSWORD: user_pass
volumes:
- ./mysql/myf:/etc/myf
- ./mysql/data:/var/lib/mysql:rw"
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin:latest
restart: always
depends_on:
- database-container
links:
- database-container
ports:
- "3001:80"
environment:
PMA_HOST: database-container
MYSQL_ROOT_PASSWORD: mysql_pass
I realized that the problem is mounting docker volumes, but I can't figure out how to fix it.
本文标签: windowsDocker Desktop restarts only part of the services in the containerStack Overflow
版权声明:本文标题:windows - Docker Desktop restarts only part of the services in the container - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745624007a2159748.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论