anacrolix / dms

A UPnP DLNA Digital Media Server that includes basic video transcoding. Tested on a Panasonic Viera television, several Android UPnP apps, and Chromecast.
BSD 3-Clause "New" or "Revised" License
646 stars 96 forks source link

Add Docker Image and Corresponding Github Action #113

Closed varbhat closed 1 year ago

varbhat commented 1 year ago

@anacrolix ,

So, I have packed dms as Docker Image(Based on alpine linux). Also, added corresponding Github action which builds docker image and pushes it to ghcr.io .I have been using this for long time and it would be helpful if you can merge this

irsl commented 1 year ago

Hey varbhat! Thanks for contributing the image workflow, this is really nice. I noticed a bug; at transcoding or the dynamic streams feature, the server goes down due to nil pointer dereference:

2023/03/13 19:32:05 http: panic serving 10.6.8.186:32886: runtime error: invalid memory address or nil pointer dereference
goroutine 9951 [running]:
net/http.(*conn).serve.func1()
        net/http/server.go:1854 +0xbf
panic({0x562be154db80, 0x562be1853d10})
        runtime/panic.go:890 +0x263
github.com/anacrolix/dms/dlna/dms.(*Server).serveDLNATranscode.func2({0xc0000f5ba8, 0x18})
        github.com/anacrolix/dms/dlna/dms/dms.go:446 +0x3f

This is because golang is unable to look up the default user 1000 inside the container. Would you mind sending a fix?

varbhat commented 1 year ago

@irsl , I will do it. But, before that, can you try with -u flag?

docker run -u 1000:1000 ? Does this fix your problem or should i add default user 1000 in alpine container?

irsl commented 1 year ago

-u nobody:nogroup does fix the problem since that user is present in /etc/passwd.