glifio / filecoin-docker

A Docker image for Lotus Filecoin nodes
Apache License 2.0
59 stars 29 forks source link

Cant get this to work #93

Open Motophan opened 10 months ago

Motophan commented 10 months ago

[gentoo@old ~]$ docker logs lotus

===> ENV Variables ...
INFRA_IMPORT_SNAPSHOT="true"
INFRA_LOTUS_DAEMON="true"
INFRA_LOTUS_GATEWAY="true"
INFRA_SYNC="true"
===> Configuring ...
INFRA_LOTUS_HOME is empty
===> ENV Variables ...
INFRA_IMPORT_SNAPSHOT="true"
INFRA_LOTUS_DAEMON="true"
INFRA_LOTUS_GATEWAY="true"
INFRA_SYNC="true"
===> Configuring ...
INFRA_LOTUS_HOME is empty
===> ENV Variables ...
INFRA_IMPORT_SNAPSHOT="true"
INFRA_LOTUS_DAEMON="true"
INFRA_LOTUS_GATEWAY="true"
INFRA_SYNC="true"
===> Configuring ...
INFRA_LOTUS_HOME is empty
version: "2.1"
networks:
  default:
    driver: bridge
    ipfs:
          image: ipfs/kubo:latest
          container_name: ipfs
          environment:
            - IPFS_PROFILE=server
            - IPFS_PATH=/ipfsdata
          volumes:
            - /home/gentoo/docker/ipfs:/ipfsdata
          ports:
            - 4001:4001
            - 127.0.0.1:8080:8080
            - 127.0.0.1:8081:8081
            - 127.0.0.1:5001:5001
    lotus:
          image: glif/lotus:v1.23.3-gw-mainnet-amd64
          env_file:
              - .env
          user: lotus_user
          container_name: lotus
          volumes:
            - $HOME/docker/lotus:/home/lotus_user
          ports:
            - 127.0.0.1:1234:1234
            - 127.0.0.1:1235:1235
          environment:
            - INFRA_SYNC="true"
            - INFRA_IMPORT_SNAPSHOT="true"
            - INFRA_LOTUS_DAEMON="true"
            - INFRA_LOTUS_GATEWAY="true"

Shouldnt this just work? I need to run a lotus node, a posgres db, a ipfs node, and

ArseniiPetrovich commented 10 months ago

What is the content of your .env file? Are you using the default one? Is it located in the path specified in your docker-compose (.env)?

Motophan commented 10 months ago
[gentoo@old ~]$ cat docker/.env
INFRA_CLEAR_RESTART=false
INFRA_IMPORT_SNAPSHOT=true
INFRA_LOTUS_DAEMON=true
INFRA_LOTUS_GATEWAY=true
INFRA_PERSISTNODEID=false
INFRA_SECRETVOLUME=false
INFRA_SYNC=true
SNAPSHOTURL=https://snapshots.mainnet.filops.net/minimal/latest.zst
INFRA_LOTUS_HOME=/home/lotus_user
[gentoo@old ~]$
dumikau commented 10 months ago

Hello there! :)

So, the number of variables that's being printed at the beginning of your log doesn't match the number of variables in the .env file. I can assume that's a variable precedence issue where the variables specified in the environment section replace the variables from the env file altogether. And INFRA_LOTUS_HOME is a required variable, so without it being set our scripts simply exit.

I would advise to choose between setting variables via the env file OR the environment section to avoid variable precedence issues in the future.