p1c2u/vscode-docker-compose

Containers with `container_name` property are not displayed in sidebar

Closed this issue · 5 comments

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

@FancyBanana can you see it after refresh?

p1c2u commented

What docker-compose ps command shows you?

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

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