p1c2u / vscode-docker-compose

Docker Compose Extension for Visual Studio Code
MIT License
18 stars 8 forks source link

Containers with `container_name` property are not displayed in sidebar #30

Closed FancyBanana closed 5 years ago

FancyBanana commented 5 years ago

This is a basic docker-compose.yml that demonstrates the issue:

version: "3.7"

services:
  tets:
      image: hypriot/rpi-whoami
      container_name: whoami
      ports:
        - 8080:8080

When i start the project through the sidebar the container starts and works but it is not displayed.

p1c2u commented 5 years ago

@FancyBanana can you see it after refresh?

FancyBanana commented 5 years ago

No I can't

On Tue, 26 Feb 2019, 14:51 A, notifications@github.com wrote:

@FancyBanana https://github.com/FancyBanana can you see it after refresh?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/p1c2u/vscode-docker-compose/issues/30#issuecomment-467445640, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkVH5pUvvtKGUJcGOQFpjKeknKK6hvaks5vRTv7gaJpZM4bSHWS .

p1c2u commented 5 years ago

What docker-compose ps command shows you?

FancyBanana commented 5 years ago

Without container_name:

     Name                  Command               State                                             Ports                                          
--------------------------------------------------------------------------------------------------------------------------------------------------
demo_rabbitmq_1  docker-entrypoint.sh rabbi ...   Up      15671/tcp, 0.0.0.0:8081->15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 0.0.0.0:8088->5672/tcp

With container_name:

Name              Command               State                                             Ports                                          
-----------------------------------------------------------------------------------------------------------------------------------------
rmq    docker-entrypoint.sh rabbi ...   Up      15671/tcp, 0.0.0.0:8081->15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 0.0.0.0:8088->5672/tcp

Edit: Here's docker-compose file that i use:

version: "3.7"

services:
  rabbitmq:
    image: rabbitmq:management-alpine
    tty: true
    # container_name: rmq
    environment:
      - RABBITMQ_DEFAULT_VHOST=${RMQ_VHOST}
      - RABBITMQ_DEFAULT_USER=${RMQ_USER}
      - RABBITMQ_DEFAULT_PASS=${RMQ_PASSWORD}
    ports:
      - ${PORT_WEB}:15672
      - ${PORT_SERVER}:5672
p1c2u commented 5 years ago

ATM it's not possible to support comtainer_name. docker-compose cli has no possibility to map containers to services.