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/Docker Compose: can't open file 'hss.py' #193

Open
mazz opened this issue Mar 21, 2024 · 0 comments
Open

Docker/Docker Compose: can't open file 'hss.py' #193

mazz opened this issue Mar 21, 2024 · 0 comments

Comments

@mazz
Copy link

mazz commented Mar 21, 2024

In order to get to the error can't open file 'hss.py', I needed to solve a catch-22 situation where I needed a static ip address before the docker build so I made a custom docker network for pyhss so I can preset the docker internal ip address for pyhss:

docker network create --subnet 172.31.0.1/16 --internal hss

and when I run docker network inspect $(docker network ls | awk '$3 == "bridge" { print $1}') | jq -r '.[] | .Name + " " + .IPAM.Config[0].Subnet' - I can see the new network:

...
hss 172.31.0.1/16
...

my docker-compose.yaml:

version: '3'
networks:
  hss:
    ipam:
      config:
        - subnet: "17.31.0.0/16"
services:
  pyhss:
    build: .
    image: pyhss
    container_name: pyhss
    env_file:
      - .env
    environment:
      - COMPONENT_NAME=hss-1
    volumes:
      - ./pyhss:/mnt/hss
    expose:
      - "3868/tcp"
      - "3868/sctp"
    ports:
      - "3868:3868/tcp"
      - "3868:3868/sctp"
    networks:
      hss:
        ipv4_address: "17.31.0.2"

After doing this, I managed to get the Dockerfile building, however I see another error:

pyhss  | /usr/bin/python3: can't open file 'hss.py': [Errno 2] No such file or directory
pyhss exited with code 2

This appears to be a bug. Where is hss.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant