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 Compose File Issues #20

Open
rastacalavera opened this issue Sep 28, 2022 · 8 comments
Open

Docker Compose File Issues #20

rastacalavera opened this issue Sep 28, 2022 · 8 comments

Comments

@rastacalavera
Copy link

Hello!
I am trying to use your docker compose file and am running into issues.

I had to add --- and services: to the top of the file, then indent icecast and all the - values after to get the compose to function as expected.
Once the compose file was functional, there was an issue in launching the container:

2022-09-28T14:26:47.479555159Z FATAL: could not open error logging (/var/log/icecast2/error.log): Permission denied
2022-09-28T14:26:47.479595516Z FATAL: could not open access logging (/var/log/icecast2/access.log): Permission denied
2022-09-28T14:26:47.479605280Z FATAL: Could not start logging

When I looked at the ownership of the log folder, it was root. I tried to chown it to my user and restart but it didn't correct the error. After that, I deleted the folder and tried adding PUID and GUID values for my user to the compose file, but the folder created was still owned by root and the same error persisted. My compose file is shown below:

---
services:
  icecast:
    image: moul/icecast
    container_name: icecast
    volumes:
      - ./logs:/var/log/icecast2
      - /etc/localtime:/etc/localtime:ro
    environment:
      - PUID=1000
      - GUID=1000
      - ICECAST_SOURCE_PASSWORD=aaa
      - ICECAST_ADMIN_PASSWORD=bbb
      - ICECAST_PASSWORD=ccc
      - ICECAST_RELAY_PASSWORD=ddd
      - ICECAST_HOSTNAME=10.10.1.14
    ports:
      - 8003:8000

I have a folder in my home directory called icecast so the log folder is being created as a subdirectory of that /home/rastacalavera/icecast/logs

Any ideas on where this permission issue may be holding things up?

@rastacalavera
Copy link
Author

Maybe the Docker file needs a RUN chmod 777 /var/log/icecast2/access.log and RUN chmod 777 /var/log/icecast2/error.log ?

Got the idea from this post

@roelmeijer
Copy link
Contributor

I have the same problem

@makidoll
Copy link

I ran sudo chown -R 101:102 logs which fixes the issue

@chicodaman
Copy link

Hi - Similar issue here...not sure if it's the same one as above...

I added the compose code (reformatted as described above) to my docker-compose.yml file:

icecast:
  image: moul/icecast
  volumes:
  - logs:/var/log/icecast2
  - /etc/localtime:/etc/localtime:ro
  environment:
  - ICECAST_SOURCE_PASSWORD=aaa
  - ICECAST_ADMIN_PASSWORD=bbb
  - ICECAST_PASSWORD=ccc
  - ICECAST_RELAY_PASSWORD=ddd
  - ICECAST_HOSTNAME=noise.example.com
  ports:
  - 8000:8000

...but get the following error:

thisUser@raspberrypi4:~/IOTstack $ docker-compose up -d
service "icecast" refers to undefined volume logs: invalid compose project

Any suggestions? Much appreciated and thanks.

@makidoll
Copy link

You're missing services: at the top

@chicodaman
Copy link

Thanks for the response.

You're missing services: at the top

Sorry, I should have been more clear.

I added the code in my previous post to an already functioning docker-compose.yml file.

So the docker-compose.yml actually looks like this:

networks:
  default:
...
# (stuff omitted here)
...

services:
  mosquitto:
    container_name: mosquitto
    build:
 ...
# (stuff omitted here, including multiple services: mosquitto, node-red, grafana, influxdb, etc.)
...

icecast:
  image: moul/icecast
  volumes:
  - logs:/var/log/icecast2
  - /etc/localtime:/etc/localtime:ro
  environment:
  - ICECAST_SOURCE_PASSWORD=aaa
  - ICECAST_ADMIN_PASSWORD=bbb
  - ICECAST_PASSWORD=ccc
  - ICECAST_RELAY_PASSWORD=ddd
  - ICECAST_HOSTNAME=noise.example.com
  ports:
  - 8000:8000

The icecast added section has been formatted so it's correctly indented along with the other existing services (as per the first post in this thread). So wiith that clarified, anything stand out that might cause the issue:

thisUser@raspberrypi4:~/IOTstack $ docker-compose up -d
service "icecast" refers to undefined volume logs: invalid compose project

?

@makidoll
Copy link

Oh you didn't define logs as a docker volume. You might want to change it to ./logs:... so you can then do chown 101:102. Or define logs as a volume near the top

@chicodaman
Copy link

Got it! Thanks...

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

4 participants