diff --git a/cutorch-1.0-0/Dockerfile b/cutorch-1.0-0/Dockerfile new file mode 100644 index 0000000..f148f96 --- /dev/null +++ b/cutorch-1.0-0/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:latest + +# Install dependencies +RUN apt-get update -y \ + && apt-get install -yqq libssl-dev git-core sudo \ + && apt-get clean + +# Install torch and cutorch 1.0-0 +RUN git clone https://github.com/torch/distro.git /torch --recursive \ + && cd /torch \ + && /bin/bash install-deps \ + && sed -i 's/cutorch-scm-1.rockspec/cutorch-1.0-0.rockspec/g' install.sh \ + && ./install.sh -b \ + && apt-get clean diff --git a/cutorch-1.0-0/cutorch b/cutorch-1.0-0/cutorch new file mode 100755 index 0000000..8d805b5 --- /dev/null +++ b/cutorch-1.0-0/cutorch @@ -0,0 +1,29 @@ +DOCKER_IMAGE='cutorch' +CONTAINER_USERNAME='cutorch' +CONTAINER_GROUPNAME='cutorch' +HOMEDIR=/home/${CONTAINER_USERNAME} +GROUP_ID=$(id -g) +USER_ID=$(id -u) + +create_user_cmd() +{ + echo \ + groupadd -f -g ${GROUP_ID} ${CONTAINER_GROUPNAME} '&&' \ + useradd -u ${USER_ID} -g ${CONTAINER_GROUPNAME} ${CONTAINER_USERNAME} '&&' \ + mkdir --parent ${HOMEDIR} '&&' \ + chown -R ${CONTAINER_USERNAME}:${CONTAINER_GROUPNAME} ${HOMEDIR} +} + +execute_as_cmd() +{ + echo sudo -u ${CONTAINER_USERNAME} HOME=${HOMEDIR} +} + +full_container_cmd() +{ + echo "$(create_user_cmd) && $(execute_as_cmd) $@" +} + +nvidia-docker run -it --rm -p 8888:8888 -v "$(pwd)":"${HOMEDIR}" -w "${HOMEDIR}" "${DOCKER_IMAGE}" + + diff --git a/tensorflow/Dockerfile b/tensorflow/Dockerfile index 6f5c9fd..bce680c 100644 --- a/tensorflow/Dockerfile +++ b/tensorflow/Dockerfile @@ -1,3 +1,13 @@ FROM tensorflow/tensorflow:latest-gpu -RUN apt-get update -y && apt-get install sudo -y +# Install dependencies +RUN apt-get update -y \ + && apt-get install -yqq libssl-dev git-core sudo \ + && apt-get clean + +# Install needed python packages +RUN pip install keras \ + pandas-datareader \ + quandl \ + h5py \ + git+https://github.com/tflearn/tflearn.git diff --git a/tensorflow/tensorflow b/tensorflow/tensorflow index 4099adc..e3f9903 100755 --- a/tensorflow/tensorflow +++ b/tensorflow/tensorflow @@ -24,6 +24,6 @@ full_container_cmd() echo "$(create_user_cmd) && $(execute_as_cmd) $@" } -docker run -it --rm -v "$(pwd)":"${HOMEDIR}" -w "${HOMEDIR}" "${DOCKER_IMAGE}" /bin/bash -ci "$(full_container_cmd $@)" +nvidia-docker run -it --rm -p 8888:8888 -v "$(pwd)":"${HOMEDIR}" -w "${HOMEDIR}" "${DOCKER_IMAGE}"