philosowaffle / ambientweather-local-server

A server for receiving metrics from your local Ambient Weather Console and exposing them as Prometheus Metrics
https://philosowaffle.github.io/ambientweather-local-server/
GNU General Public License v3.0
30 stars 5 forks source link

[Bug] container won't start #41

Open jpriebe opened 2 months ago

jpriebe commented 2 months ago

Container won't start - watching the events, I can see the container dies right away, and the only thing it has in the logs is this:

chown: changing ownership of '/app/configuration.local.json': Read-only file system

My docker-compose is essentially the same as the example in the documentation.

  ambient-weather:
    container_name: ambient-weather-server
    image: philosowaffle/ambientweather-local-server:latest
    ports:
      - 8001:8080
    environment:
      - TZ=America/Chicago
    volumes:
      - /appdata/ambient-weather/configuration.local.json:/app/configuration.local.json:ro
      - /appdata/ambient-weather/output:/app/output # optional, logs may be written here based on your configuration

I don't understand why the code is calling chown on /app when the volume mapping specifically puts a read-only file into the /app directory.

But I'm pretty sure that chown is failing, causing the entrypoint script to bail out and the container won't start.

Using Fedora Server 40.

jpriebe commented 2 months ago

The more I look around, the more confused I am. The Dockerfile puts configuration.local.json into /app/api, but the docker-compose.yaml has it mounted as a volume under /app.

And it may not have anything to do with this configuration file being read-only. I wonder, is the issue just that the container's entire filesystem is read-only?

I don't get the chown and chmod calls -- generally, you don't want to modify files that are part of the container image, do you?

jpriebe commented 2 months ago

Well, I removed the ":ro" from the json volume, and it looks like it started up.