ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.84k stars 901 forks source link

Docker compose: /usr/bin/env: 'python3': No such file or directory #3765

Closed educob closed 4 years ago

educob commented 4 years ago

Hi.

I have the following c-lightning service in a docker-compose.yml file:

  clightning_bitcoin:
    image: elementsproject/lightningd
    container_name: testnetln
    command:
      - --network=testnet
      - --bitcoin-rpcconnect=testnetnode
      - --bitcoin-rpcuser=xxx
      - --bitcoin-rpcpassword=yyy
      - --bind-addr=0.0.0.0:9901
      - --alias=bappTestnet
      - --log-level=debug
      - --plugin=/root/.lightning/ln_testnet.py

    environment:
      EXPOSE_TCP: "true"
    expose:
      - "9901"
    ports:
      - "0.0.0.0:9901:9901"
    volumes:
      - "/media/r2d2/ssd_2/testnet/ln:/root/.lightning"
      - "/media/r2d2/ssd_2/testnet/bitcoin:/etc/bitcoin"
    links:
      - testnetnode

As you can see I am running a python plugin: /root/.lightning/ln_testnet.py

When upping the docker-compose I get error: /usr/bin/env: 'python3': No such file or directory

I have seen this kind of errors when running docker on windows because EOL but I am running on linux-mint 19.2

Thanks.

UPDATE: I think the problem is that there no python3 installed on the image. I have open a bash and tried to run "apt-get install python3" but it doesn't find the package I can't figure it out why.

cdecker commented 4 years ago

UPDATE: I think the problem is that there no python3 installed on the image. I have open a bash and tried to run "apt-get install python3" but it doesn't find the package I can't figure it out why.

That is indeed correct, we don't install python3 in the base docker image. The reason you aren't seeing it when trying to install with apt is that we remove the apt repository caches to make the image smaller. You have to do an apt update first, and then it'll find python3 as well.

I'll add python3 to the base image, since most of our plugins are indeed written in python.

educob commented 4 years ago

Thanks. I'll try that.