-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
update docker #325
update docker #325
Conversation
1e44b40
to
9b91da1
Compare
bd41c84
to
81430bd
Compare
81430bd
to
24501e9
Compare
@ABeltramo could you please review this PR when you have time? Most importantly, the |
I encountered a few issues by checking this out on my local machine, I'll present them in order: Docker build failedI started by trying to build the image and this error was returned: My suggestion is to add a
This will also avoid invalidating the cache when changing stuff that's not going into the container anyway. TZ, PUID and PGID aren't mappedWhile you specified them as part of possible environment variables they aren't mapped to anything in the dockerfile. Docker doesn't take care of them automagically (unfortunately). If you set them as The correct way is to set them as Running the container doesn't workAfter building the docker image I tried to run it but I've got the following error:
Let's see what's in the docker image then:
Found it! It looks like Sunshine is installed at Let's run it!I've changed the entrypoint, rebuilt and run:
Nothing happens, no log message, no output. The process is stuck there eating CPU at 100% but worst of all allocating memory like crazy! (it keeps growing, here at ~6.5GB of RAM used I forcefully killed the container). I don't know what the issue is but this seems pretty bad. Final commentsThere are a few things missing in this Dockerfile compared to the Dockerfile on GOW most notably:
Even assuming that the final container is in a good state the instructions in the Some might say this looks like a completely different project and that's probably why you should point people to GOW instead 😉 |
I was thinking about avoiding duplicating efforts, the best way forward might be to provide a skeleton Docker image which includes the latest Sunshine build similar to what you have right now (just fix the Since there's no one way of running Sunshine, with this anyone can create their own Docker image based on what they want to achieve; for example: FROM lizardbyte/sunshine
# install Wayland and Steam
ENTRYPOINT start-wayland && start-steam && start-sunshine You also don't have to deal with PID/GUID/TZ or any other runtime option, just keep a simple docker image that people can expand on. Let me know what you think! |
Revisiting this again. I agree with this idea and my updates to this branch "should" reflect that. These items from your previous review should be fixed as well.
Not real sure about the CPU and ram usage. My only guess would be that Sunshine was continuously crashing and restarting? |
I have to spend some more time in trying this out with GOW but I have a quick suggestion, first:
This is probably not the best way forward; processes in Docker container shouldn't run as root. I think it would be better to create a default user but also give users the ability to override that at build time (if needed). Something like: FROM sunshine-base as sunshine
# copy deb from builder
COPY --from=sunshine-build /root/sunshine-build/build/cpack_artifacts/Sunshine.deb /sunshine.deb
# install sunshine
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends /sunshine.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV TZ="Europe/London"
ARG UNAME=retro
ENV UNAME=${UNAME}
ARG PUID=1000
ENV PUID=${PUID}
ARG PGID=1000
ENV PGID=${PGID}
RUN groupadd -f -g "${PGID}" "${UNAME}"
RUN useradd -mk "$(mktemp -d)" -u "${PUID}" -g "${PGID}" "${UNAME}"
ENV HOME=/home/$UNAME
USER ${UNAME}
# network setup
EXPOSE 47984-47990/tcp
EXPOSE 48010
EXPOSE 47998-48000/udp
# setup config directory
RUN mkdir ${HOME}/config
# entrypoint
ENTRYPOINT ["/usr/bin/sunshine", "${HOME}/config/sunshine.conf"] |
f677b7c
to
6c0fc48
Compare
- add user setup - simplify `ENTRYPOINT` by creating symbolic link to user's config directory Co-Authored-By: ABeltramo <[email protected]>
bf7625e
to
497e609
Compare
497e609
to
d327495
Compare
Description
Screenshot
Issues Fixed or Closed
Type of Change
Checklist