AndreySenov / firebase-tools-docker

Dockerfile for firebase-tools image
https://hub.docker.com/r/andreysenov/firebase-tools
Other
132 stars 40 forks source link

Container exits without doing anything. No log, no execution, nothing. #38

Open caner-cetin opened 1 year ago

caner-cetin commented 1 year ago

Latest firebase-tools: image

Simply just ran: docker run -p 9199:9199 -p 9099:9099 -p 9005:9005 -p 9000:9000 -p 8085:8085 -p 8080:8080 -p 5001:5001 -p 5000:5000 -p 4000:4000 -v /path/to/project:/home/node --name firebase-tools andreysenov/firebase-tools

as written in https://github.com/AndreySenov/firebase-tools-docker/blob/main/doc/guide/running_firebase_emulators.md

and container exits without doing anything. exit 0, so no error.

image

huge nothing. my main project is written with Python, but I dont think it is a problem. Help?

caner-cetin commented 1 year ago

I can see emulators and all that stuff, so container is actually building successfully. image

caner-cetin commented 1 year ago

Tried to run with a docker-compose.yml:

version: '3'
services:
  app:
    container_name: firebase
    image: andreysenov/firebase-tools
    user: node
    command: >
        sudo firebase emulators:start
        tail -f /dev/null
    ports:
      - 4000:4000
      - 5000:5000
      - 5001:5001
      - 8080:8080
      - 8085:8085
      - 9000:9000
      - 9005:9005
      - 9099:9099
      - 9199:9199
    volumes:
      - ./app_dir:/home/node
volumes:
  app_dir:

and got Error: Cannot find module '/home/node/sudo', without sudo, I get:

image

AndreySenov commented 1 year ago

Hi @DAMACANER , Thank you for you feedback. I'm sorry for late response. I reviewed the Dockerfiles recently and added packages and peer dependencies needed for firebase-tools. Please try pulling the latest image. The guide you mentioned was provided by one of the contributors long time ago. I'll try to review it if your problem exists after pulling newer images. Thank you

Tomek6789 commented 1 year ago

@AndreySenov Unfortunately. Problem still exists. I pulled image today and have the same situation as in this issue. Containers starts and than stops without any logs.

twkevinzhang commented 1 year ago

This is because the last line of the dockerfile is CMD ["sh"] instead of CMD ["firebase", "emulator:start"], so you should use the following command to run:

docker run -p 9199:9199 -p 9099:9099 -p 9005:9005 -p 9000:9000 -p 8085:8085 -p 8080:8080 -p 5001:5001 -p 5000:5000 -p 4000:4000 -v /path/to/project:/home/node --name firebase-tools andreysenov/firebase-tools firebase emulators:start --project YOUR_PROJECT

The following docker-compose.yaml works fine:

firebase-emulator:
    image: andreysenov/firebase-tools:latest
    restart: always
    volumes:
      - .:/home/node
    command:
        - "firebase"
        - "emulators:start"
        - "--project"
        - "MY_PROJECT_ID"
    ports:
      - "9199:9199"
      - "9099:9099"
      - "9005:9005"
      - "9000:9000"
      - "8085:8085"
      - "8080:8080"
      - "5001:5001"
      - "5000:5000"
      - "4000:4000"
sharaf84 commented 1 year ago

You can try adding -it like that: docker run -it -p 9199:9199 -p 9099:9099 -p 9005:9005 -p 9000:9000 -p 8085:8085 -p 8080:8080 -p 5001:5001 -p 5000:5000 -p 4000:4000 -v /path/to/project:/home/node --name firebase-tools andreysenov/firebase-tools