From d34338ba70d04bcfd099f79360ffc4d186cc95cb Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Thu, 11 Jul 2019 02:56:31 +0300 Subject: [PATCH] added dockerfile and docker entrypoint script --- Dockerfile | 7 +++++++ docker-entrypoint.sh | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01748c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM nvidia/cuda:latest + +RUN mkdir -p /usr/local/bin /patched-lib +COPY patch.sh docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/patch.sh /usr/local/bin/docker-entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..4e83878 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +echo "/patched-lib" > /etc/ld.so.conf.d/000-patched-lib.conf && \ +PATCH_OUTPUT_DIR=/patched-lib /usr/local/bin/patch.sh && \ +cd /patched-lib && \ +for f in * ; do + suffix="${f##*.so}" + name="$(basename "$f" "$suffix")" + ln -s "$f" "$name" + ln -s "$f" "$name.1" +done && \ +ldconfig +[ "$OLDPWD" ] && cd - +exec "$@"