Skip to content

Multiple containers with same image on same host #608

Description

@elmr91

On a docker host I have 2 containers configured from same image but with different options:

Examples:

Vanilla Minecraft server

services:
  mc:
    image: itzg/minecraft-server
    container_name: minecraft
    ports:
      - 25565:25565
    environment:
      MOTD: "Vanilla Minecraft"
      EULA: "TRUE"
      ENABLE_RCON: "true"
      RCON_PASSWORD: minecraft
      RCON_PORT: 28016
      restart: always
    volumes:
    - /home/docker/minecraft:/data

And a second one with different options

services:
  mc:
    image: itzg/minecraft-server
    container_name: forge-mc
    ports:
      - 25567:25565
    environment:
      TYPE: "FORGE"
      #FORGE_VERSION: "14.23.5.2854"
      MOTD: "Disneyland Server"
      MODE: "creative"
      MEMORY: "4G"
      LEVEL_TYPE: "FLAT"
      EULA: "TRUE"
      ENABLE_RCON: "true"
      RCON_PASSWORD: minecraft
      RCON_PORT: 28016
      restart: always
    volumes:
    - /home/docker/disneyland:/data

Only one container is published to MQTT (and home assistant)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions