Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose does not start container for second environment on host Windows Server 2022. #10895

Closed
mariotomek opened this issue Aug 11, 2023 · 6 comments
Labels

Comments

@mariotomek
Copy link

Discussed in https://github.com/docker/compose/discussions/10894

Originally posted by mariotomek August 11, 2023
Hi, I am having problem with starting container from second compose.yml and moreover only on docker host with OS Windows Server 2022. I will describe the situation.

I need two same web applications on diferent URL adresses with own databases. So I have created two compose.yml files (compose-env01.yml and compose-env02.yml) for running two environments (env01 and env02). Each environment include two containers (web and mssql DB).

After build compose-env01.yml and compose-env02.yml are the images for web same for env01 and env02. Also images for mssql are the same for env01 and env02:
image
Differents betweens compose-env01.yml and compose-env02.yml are only in using ports, as you can see:

compose-env01.yml:

version: "3.8"
services:
  web:
    build: ./web-mw
    isolation: 'default'
    hostname: web
    deploy:
      resources:
        limits:
          memory: 8G
    ports:
      - "7001:443"
    environment:
      "#CONFSETTINGS_PORT_MW#": "7001"
      "#CONFSETTINGS_MSSQLSERVERPORT#": "14331"
    depends_on:
      - mssql
  mssql: 
    build: ./database
    isolation: 'default'
    hostname: mssql
    ports:
      - "14011:14331"
    expose:
      - "14331"
    volumes:
      - .\volumes\db:C:\sqlbak
    storage_opt:
      size: '25G'
    environment:
      SA_PASSWORD: "Your_password"
      ACCEPT_EULA: "Y"
      MSSQL_PID: "Developer"
      ChangeMSSQLServerPort: "TRUE"
      MSSQLServerPort: "14331"

compose-env02.yml:

version: "3.8"
services:
  web:
    build: ./web-mw
    isolation: 'default'
    hostname: web
    deploy:
      resources:
        limits:
          memory: 8G
    ports:
      - "7002:443"
    environment:
      "#CONFSETTINGS_PORT_MW#": "7002"
      "#CONFSETTINGS_MSSQLSERVERPORT#": "14332"
    depends_on:
      - mssql
  mssql: 
    build: ./database
    isolation: 'default'
    hostname: mssql
    ports:
      - "14012:14332"
    expose:
      - "14332"
    volumes:
      - .\volumes\db:C:\sqlbak
    storage_opt:
      size: '25G'
    environment:
      SA_PASSWORD: "Your_password"
      ACCEPT_EULA: "Y"
      MSSQL_PID: "Developer"
      ChangeMSSQLServerPort: "TRUE"
      MSSQLServerPort: "14332"

When I run containers from env01 using command "docker compose -p env01 -f compose-env01.yml up -d", both containers start correctly. Then I want to run containers from env02 using "docker compose -p env02 -f compose-env02.yml up -d". But now will start only container env02-mssql-1 and container env02-web-1 remains in the state Starting:
image

And this is the problem. This only happens on docker host with OS Windows Server 2022. The same configuration on docker host with OS Windows Server 2019 is OK and all containers from env01 and env02 start correctly.

Using versions are:
Docker version 24.0.4, build 3713ee1
Docker Compose version v2.20.2

So could you pleas help me anybody with this problem?

@milas
Copy link
Contributor

milas commented Aug 15, 2023

While env02-web-1 is in "Starting", can you inspect it from another terminal (docker inspect env02-web-1)?

@mariotomek
Copy link
Author

Hi @milas, no when the env02-web-1 is in "Starting" state, it is not possible to inspect it because it has not started yet. I tried it many times. I created a topic also on forums.docker.com. There is already more information on this issue. But it looks like it will probably be some kind of bug in docker.

@westy
Copy link

westy commented Sep 11, 2023

Sounds related to #8978 from last year!

@emagiz
Copy link

emagiz commented Feb 9, 2024

We are also (reproducable) experiencing this issue. As described by the @mariotomek , this occurs when two stacks with port mappings are deployed on the same windows server 2022.

If any workaround of fix is known, we would like to know aswell. AFAIK no fix exists.

@mariotomek
Copy link
Author

We are also (reproducable) experiencing this issue. As described by the @mariotomek , this occurs when two stacks with port mappings are deployed on the same windows server 2022.

If any workaround of fix is known, we would like to know aswell. AFAIK no fix exists.

Hi @emagiz, I posted this issue also on forums.docker.com, and here is workaround that work for me: forums.docker.com. Hopefully it will help you!

Copy link

github-actions bot commented Sep 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants