From 5c40ed19b6dc2f526129fd125129031dd98d9d8e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 23 May 2022 12:35:37 -0400 Subject: [PATCH] docker shim: Boost singlarity to 3.10.0 - have dedicated one for arm64 (Mac M1) See https://github.com/ReproNim/containers/issues/67 --- scripts/Dockerfile.singularity-arm64-shim | 26 +++++++++++++++++++++++ scripts/Dockerfile.singularity-shim | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 scripts/Dockerfile.singularity-arm64-shim diff --git a/scripts/Dockerfile.singularity-arm64-shim b/scripts/Dockerfile.singularity-arm64-shim new file mode 100644 index 00000000..24d34c9f --- /dev/null +++ b/scripts/Dockerfile.singularity-arm64-shim @@ -0,0 +1,26 @@ +# no longer pushed to - vanessa declared dockerhub insecure +#FROM singularityware/singularity:v3.3.0-slim +FROM quay.io/singularity/singularity:v3.10.0-arm64 + +RUN apk update \ + && apk add bash sudo \ + && rm -rf /var/cache/apk/* \ + && mv /etc/localtime /etc/localtime.docker \ + && printf '#!/bin/bash\n\ + set -eu\n\ + USERNAME=$(sed -rn "s/^([^:]+):[^:]+:${UID}:.*/\\1/p" /etc/passwd)\n\ + GROUPNAME=$(sed -rn "s/^([^:]+):[^:]+:${GID}:.*/\\1/p" /etc/group)\n\ + if [ -z "$USERNAME" ]; then\n\ + USERNAME=host-user\n\ + if [ -z "$GROUPNAME" ]; then\n\ + GROUPNAME=host-user\n\ + addgroup -g $GID host-user\n\ + fi\n\ + adduser -u $UID -G "$GROUPNAME" -D host-user\n\ + fi\n\ + sudo -u "$USERNAME" /usr/local/singularity/bin/singularity "$@"\n\ + ' > /entrypoint.sh \ + && chmod +s /usr/local/singularity/libexec/singularity/bin/starter-suid \ + && chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/scripts/Dockerfile.singularity-shim b/scripts/Dockerfile.singularity-shim index e2d50e87..3566f265 100644 --- a/scripts/Dockerfile.singularity-shim +++ b/scripts/Dockerfile.singularity-shim @@ -1,6 +1,6 @@ # no longer pushed to - vanessa declared dockerhub insecure #FROM singularityware/singularity:v3.3.0-slim -FROM quay.io/singularity/singularity:v3.7.0-slim +FROM quay.io/singularity/singularity:v3.10.0-slim RUN apk update \ && apk add bash sudo \