https://rancher.com/ logo
a

adventurous-insurance-41443

07/18/2022, 4:48 PM
I have a compose file that successfully boots up a container when I run
nerdctl compose up --build
. The webserver in the container is running without error. But when I try to hit it with a HTTP message, I get error
Error: connect ECONNREFUSED 127.0.0.1:8556
. (details in thread)
compose.yaml:
Copy code
networks:
  default:
    name: my-network
services:
  appllnamell:
    build:
      context: .
      dockerfile: local.Dockerfile
    ports:
      - "8556:8000"
    environment:
      AUDITLOG_S3_BUCKET: "some-value"
      AND_OTHER_ENV_VARS: "have been censored"
    restart: always
    volumes:
      - .:/root/work
The output shows that things are working and the gunicorn server is sitting and waiting for responses:
Copy code
zsh ❯ nerdctl compose up --build
WARN[0000] build.config should be relative path, got "/Users/my.name/repos/my-repo"
WARN[0000] Ignoring: volume: Bind: [CreateHostPath]
WARN[0000] found 3 orphaned containers: [0xc0001b6460 0xc0001b6540 0xc0001b6620], you can run this command with the --remove-orphans flag to clean it up
INFO[0000] Building image my-repo_appllnamell
[+] Building 65.0s (12/12) FINISHED
 => [internal] load .dockerignore                                                                                                                                                                                                                        0.1s
 => => transferring context: 2B                                                                                                                                                                                                                          0.1s
 => [internal] load build definition from local.Dockerfile                                                                                                                                                                                               0.1s
 => => transferring dockerfile: 1.66kB                                                                                                                                                                                                                   0.1s
 => [internal] load metadata for <http://docker.internal.company.com/image-name:2018.08.01.cb601300ab|docker.internal.company.com/image-name:2018.08.01.cb601300ab>                                                                                                                                          0.5s
 => [1/7] FROM <http://docker.internal.company.com/image-name:2018.08.01.cb601300ab@sha256:101e6aa1c5f1f9100000d0b84b719ebc6029e53d048ecf5988e257acb4669d2b|docker.internal.company.com/image-name:2018.08.01.cb601300ab@sha256:101e6aa1c5f1f9100000d0b84b719ebc6029e53d048ecf5988e257acb4669d2b>                                                                                    0.1s
 => => resolve <http://docker.internal.company.com/image-name:2018.08.01.cb601300ab@sha256:101e6aa1c5f1f9100000d0b84b719ebc6029e53d048ecf5988e257acb4669d2b|docker.internal.company.com/image-name:2018.08.01.cb601300ab@sha256:101e6aa1c5f1f9100000d0b84b719ebc6029e53d048ecf5988e257acb4669d2b>                                                                                    0.0s
 => [internal] load build context                                                                                                                                                                                                                        0.0s
 => => transferring context: 78B                                                                                                                                                                                                                         0.0s
 => CACHED [2/7] WORKDIR /root/work                                                                                                                                                                                                                      0.0s
 => CACHED [3/7] COPY requirements-dev.txt .                                                                                                                                                                                                             0.0s
 => CACHED [4/7] COPY requirements.txt .                                                                                                                                                                                                                 0.0s
 => CACHED [5/7] RUN pip install -r requirements-dev.txt                                                                                                                                                                                                 0.0s
 => CACHED [6/7] RUN apt-get update --allow-releaseinfo-change                                                                                                                                                                                           0.0s
 => CACHED [7/7] RUN apt-get install --yes curl                                                                                                                                                                                                          0.0s
 => exporting to oci image format                                                                                                                                                                                                                       64.2s
 => => exporting layers                                                                                                                                                                                                                                  0.0s
 => => exporting manifest sha256:4ee254513594a1fde0b31ad2d02a6a4d3c6483f6466f087f16de83f61f74b0ff                                                                                                                                                        0.0s
 => => exporting config sha256:59c277a3c93b664ca8e31c4699689bf2bb29673c97ea5c27607b52f46972cafc                                                                                                                                                          0.0s
 => => sending tarball                                                                                                                                                                                                                                  64.1s
unpacking <http://docker.io/library/risk-otb-eligibility_appllnamell:latest|docker.io/library/risk-otb-eligibility_appllnamell:latest> (sha256:4ee254513594a1fde0b31ad2d02a6a4d3c6483f6466f087f16de83f61f74b0ff)...done
INFO[0065] Creating container my-repo_appllnamell_1
INFO[0067] Attaching to logs
appllnamell_1 |[2022-07-18 16:45:18 +0000] [1] [INFO] Starting gunicorn 19.9.0
appllnamell_1 |[2022-07-18 16:45:18 +0000] [1] [INFO] Listening at: <http://0.0.0.0:8000> (1)
appllnamell_1 |[2022-07-18 16:45:18 +0000] [1] [INFO] Using worker: gthread
appllnamell_1 |[2022-07-18 16:45:18 +0000] [9] [INFO] Booting worker with pid: 9
appllnamell_1 |[2022-07-18 16:45:18 +0000] [11] [INFO] Booting worker with pid: 11
c

crooked-rocket-3338

07/18/2022, 4:53 PM
can you reach it with the IP of the WSL VM ? (to know the IP run
ip -c -o -br addr | grep eth0
in a wsl terminal). It happens to me time to time, that
localhost
do not fallback to the linux VM ...
a

adventurous-insurance-41443

07/18/2022, 4:53 PM
What is wsl?
I’m using macOS.
c

crooked-rocket-3338

07/18/2022, 4:55 PM
Haa ok forget about WSL then.
👍 1
a

adventurous-insurance-41443

07/19/2022, 2:21 PM
@fast-garage-66093 Any ideas of what is going on here or how I could get more info to help diagnose this issue? Thanks!
f

fast-garage-66093

07/19/2022, 4:48 PM
Not sure, first thing to try would be to make sure that the port is open inside the VM, so run something like
Copy code
rdctl shell curl -k <https://localhost:8556>
13 Views