From f8051eb3504a1125db06c9bf0f14dc441ebf5f5e Mon Sep 17 00:00:00 2001 From: Sander Bollen Date: Fri, 6 Mar 2020 00:26:05 +0100 Subject: [PATCH 1/3] Fix permission error and allow interactive mode in entrypoint.sh --- Dockerfile | 4 +++- entrypoint.sh | 27 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) 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 From f06d17401204db55cc4119bb7e9ee2eb9dc73eba Mon Sep 17 00:00:00 2001 From: Sander Bollen Date: Fri, 6 Mar 2020 00:31:39 +0100 Subject: [PATCH 2/3] fix typo --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f5a0432..c66724c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,7 +6,7 @@ set -e if [ "${1}" ] then exec "$@" -# otherwise we attempt to run boinc. +# otherwise we attempt to run fahclient. else /opt/fahclient/FAHClient \ --user="${USER}" \ From c373fd500f0f4348695ece78cffd3eb4bc2bfa8e Mon Sep 17 00:00:00 2001 From: Sander Bollen Date: Fri, 6 Mar 2020 23:42:44 +0100 Subject: [PATCH 3/3] undo if/else --- entrypoint.sh | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c66724c..5f08480 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,20 +1,12 @@ #!/bin/bash set -e -# 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 fahclient. -else - /opt/fahclient/FAHClient \ - --user="${USER}" \ - --team="${TEAM}" \ - --passkey="${PASSKEY}" \ - --gpu="${ENABLE_GPU}" \ - --smp="${ENABLE_SMP}" \ - --power=full \ - --gui-enabled=false \ - "${@}" -fi +/opt/fahclient/FAHClient \ + --user="${USER}" \ + --team="${TEAM}" \ + --passkey="${PASSKEY}" \ + --gpu="${ENABLE_GPU}" \ + --smp="${ENABLE_SMP}" \ + --power=full \ + --gui-enabled=false \ + "${@}"