From 76e03861bcb6971f8ca2d869aadd70c153cff53b Mon Sep 17 00:00:00 2001 From: Vladimir Protsenko Date: Mon, 16 Jan 2023 21:07:10 +0400 Subject: [PATCH] Fixed IMAGE_NAME variable --- Dockerfile | 2 ++ build.sh | 3 ++- readme.md | 2 ++ start_daemon.sh | 3 ++- start_interactively.sh | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) mode change 100644 => 100755 build.sh mode change 100644 => 100755 start_daemon.sh mode change 100644 => 100755 start_interactively.sh diff --git a/Dockerfile b/Dockerfile index aa7880e..339f18f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,12 @@ RUN mkdir /wd RUN chown ${USER}:${GROUP} /wd # SYSTEM INITIALIZATION +# RUN pip install jupyter USER ${USER} # USER INITIALIZATION +# RUN ... SHELL ["/bin/bash", "--login", "-i", "-c"] WORKDIR /wd diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 313a66f..e276c02 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ #!/bin/bash +CURDIRNAME=${PWD##*/} -docker build . -t ${USER}_${IMAGE_NAME} \ +docker build . -t ${USER}_${CURDIRNAME} \ --build-arg USER=${USER} \ --build-arg GROUP=${USER} \ --build-arg UID=$(id -u ${USER}) \ diff --git a/readme.md b/readme.md index b7c035e..f91cb8c 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,8 @@ Как использовать: ``` +git clone https://git.ai.ssau.ru/liav/docker_template myproject +cd myproject ./build.sh ./start_daemon.sh или ./start_interactively.sh ``` diff --git a/start_daemon.sh b/start_daemon.sh old mode 100644 new mode 100755 index c28fb77..9cb2b0f --- a/start_daemon.sh +++ b/start_daemon.sh @@ -1,3 +1,4 @@ #!/bin/bash +CURDIRNAME=${PWD##*/} -docker run --name ${USER}_${IMAGE_NAME} -d --gpus all -p 8900:8888 -v /home/${USER}:/wd ${USER}_${IMAGE_NAME} +docker run --name ${USER}_${CURDIRNAME} -d --gpus all -p 8900:8888 -v /home/${USER}:/wd ${USER}_${CURDIRNAME} diff --git a/start_interactively.sh b/start_interactively.sh old mode 100644 new mode 100755 index d8580fa..c587b13 --- a/start_interactively.sh +++ b/start_interactively.sh @@ -1,3 +1,4 @@ #!/bin/bash +CURDIRNAME=${PWD##*/} -docker run -it --rm --gpus "device=0" -p 8900:8888 -v /home/${USER}:/wd ${USER}_${IMAGE_NAME} \ No newline at end of file +docker run -it --rm --gpus "device=0" -p 8900:8888 -v /home/${USER}:/wd ${USER}_${CURDIRNAME}