diff --git a/Dockerfile b/Dockerfile index f0b1c91..c52f489 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,9 @@ RUN useradd --system folding && \ apt-get autoremove --yes && \ rm -rf /var/lib/apt/lists/* -COPY entrypoint.sh /opt/fahclient +COPY --chown=folding:folding entrypoint.sh /opt/fahclient + +RUN chmod +x /opt/fahclient/entrypoint.sh ENV USER "Anonymous" ENV TEAM "0" diff --git a/entrypoint.sh b/entrypoint.sh index c98ba75..f5a0432 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,20 @@ #!/bin/bash +set -e -/opt/fahclient/FAHClient \ - --user=${USER} \ - --team=${TEAM} \ - --passkey=${PASSKEY} \ - --gpu=${ENABLE_GPU} \ - --smp=${ENABLE_SMP} \ - --power=full \ - --gui-enabled=false \ - ${@} +# if a command was specified, we run that command. E.g. helpful when we do +# docker run -it /bin/bash +if [ "${1}" ] +then + exec "$@" +# otherwise we attempt to run boinc. +else + /opt/fahclient/FAHClient \ + --user="${USER}" \ + --team="${TEAM}" \ + --passkey="${PASSKEY}" \ + --gpu="${ENABLE_GPU}" \ + --smp="${ENABLE_SMP}" \ + --power=full \ + --gui-enabled=false \ + "${@}" +fi