First, i have a mariadb image from my private repository
Then I create two containers using that image inside docker compose file like these:
gptbot_database:
image: yukari/privatepj:gptbot
container_name: gptbot_database
ports:
- 3307:3306
restart: unless-stopped
tty: true
volumes:
- gptbot_database_volume:/var/lib/mysql
gptbot_database_2:
image: yukari/privatepj:gptbot
container_name: gptbot_database_2
ports:
- 3308:3306
restart: unless-stopped
tty: true
volumes:
- gptbot_database_volume:/var/lib/mysql
volumes:
gptbot_database_volume:
driver: local
driver_opts:
type: none
o: bind
I expected it should start normally but in the end. the second one always failed to start service mariadb. So after that, i did split the volume into two separated volumes.
gptbot_database:
image: yukari/privatepj:gptbot
container_name: gptbot_database
ports:
- 3307:3306
restart: unless-stopped
tty: true
volumes:
- gptbot_database_volume:/var/lib/mysql
gptbot_database_2:
image: yukari/privatepj:gptbot
container_name: gptbot_database_2
ports:
- 3308:3306
restart: unless-stopped
tty: true
volumes:
- gptbot_database_volume_2:/var/lib/mysql
volumes:
gptbot_database_volume:
driver: local
driver_opts:
type: none
o: bind
gptbot_database_volume_2:
driver: local
driver_opts:
type: none
o: bind
Then i run docker compose down
and then remove all images and containers. then run docker compose up
again. but this time two of the containers failed. I can’t tell why
Host OS: Debian 11
Docker version: 1.43 (client & server)
More background info: docker logs
return Starting Mariadb . . . . . . . . . . . . . . . . . . . failed