title: How to access docker containers on wsl 2
body: <p>I am having Ubuntu 20.04 LTS running on wsl 2. I have installed docker according to this guide <a href="https://docs.docker.com/engine/install/ubuntu/" rel="noreferrer">https://docs.docker.com/engine/install/ubuntu/</a>. I have a stack with few services (basically I want to set up an environment to test my services before pushing to prod), the stack is running as expected on production, there are portainer and RabbitMq running on it and they are accessible on the network.</p>
  <p>However, when I deploy the same stack (via docker-compose.yml) on the docker that I have installed on the ubuntu on wsl 2 <strong>I can not access the RabbitMq and the Portainer services using localhost/127.0.0.1:&lt;the published port/s&gt;</strong>. The containers are running stable from what I see with &quot;docker container ls&quot;.</p>
  <p>I have tried to set an inbound rules in the firewall - nop luck.</p>
  <p>Here is the whole service setup from the docker-compose.yml:</p>
  <pre><code>  rabbitmq:
      image: rabbitmq:3-management
      logging:
        driver: &quot;json-file&quot;
        options:
          max-file: 3
          max-size: 5m
      hostname: rabbitmq
      deploy:
        resources:
          limits:
            memory: 200M
          reservations:
            memory: 199M
      ports:
        - 15672:15672
        - 5672:5672
      env_file:
        - .env
      networks:
        - webnet
  </code></pre>