Skip to content

Commit

Permalink
Updates...
Browse files Browse the repository at this point in the history
  • Loading branch information
starlord committed May 29, 2017
1 parent 1c333cc commit 93d1da3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
14 changes: 14 additions & 0 deletions cutorch-1.0-0/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions cutorch-1.0-0/cutorch
Original file line number Diff line number Diff line change
@@ -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}"


12 changes: 11 additions & 1 deletion tensorflow/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tensorflow/tensorflow
Original file line number Diff line number Diff line change
Expand Up @@ -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}"


0 comments on commit 93d1da3

Please sign in to comment.