Skip to content

Conversation

alysrylcn01
Copy link

@alysrylcn01 alysrylcn01 commented Oct 28, 2024

Tested on 8.0 folder

Example Master Usage

version: '3.8'

services:
  mysql:
    image: my-mysql-main-branch-test:latest
    container_name: master-mysql-test
    environment:
      MYSQL_ROOT_PASSWORD: password1
      MASTER_SLAVE_ROLE: MASTER
      MYSQL_REPLICATION_USER: REP_USER
      MYSQL_REPLICATION_PASSWORD: reppassword
    ports:
      - "3306:3306"
    restart: unless-stopped
    networks:
      - mysql_net

networks:
  mysql_net:
    external: true

And Slave;

version: '3.8'

services:
  mysql:
    image: my-mysql-main-branch-test:latest
    container_name: slave1-mysql-test
    environment:
      MYSQL_ROOT_PASSWORD: password1
      MASTER_SLAVE_ROLE: SLAVE
      MYSQL_MASTER_SERVICE_HOST: master-mysql-test
      MYSQL_REPLICATION_USER: REP_USER
      MYSQL_REPLICATION_PASSWORD: reppassword
    ports:
      - "3307:3306"
    restart: unless-stopped
    networks:
      - mysql_net

networks:
  mysql_net:
    external: true

@tianon
Copy link
Member

tianon commented Oct 28, 2024

I'm glad you were able to make this work for your use case! Unfortunately, this is not code we want to maintain.

The good news is that the entrypoint script is explicitly designed such that you can source it in a new script and re-use the functions to implement your own logic like this without too much overhead/maintenance burden (essentially just maintaining your new functionality; see #471 and docker-library/postgres#496 for details).

@FORALL-FA

This comment was marked as spam.

@tianon tianon closed this Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants