Skip to content

Commit

Permalink
Add cuda-ssh:10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaixhin committed Apr 26, 2019
1 parent b26bffd commit 6889470
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cuda-ssh/cuda_v10.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Start with CUDA base image
FROM nvidia/cuda:10.1-devel-ubuntu16.04
MAINTAINER Kai Arulkumaran <design@kaixhin.com>

# Install OpenSSH, X server and libgtk (for NVIDIA Visual Profiler)
RUN apt-get update && apt-get install -y \
openssh-server \
xdm \
libgtk2.0-0
# Set password
COPY password.txt .
RUN mkdir /var/run/sshd && \
echo "root:`cat password.txt`" | chpasswd && \
# Allow root login with password
sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config && \
echo "AllowUsers root" >> /etc/ssh/sshd_config && \
# Clean up
rm password.txt
# Expose SSH port
EXPOSE 22
# Add CUDA back to path during SSH
RUN echo "export PATH=$PATH" >> /etc/profile && \
echo "ldconfig" >> /etc/profile

# Run SSH daemon
CMD ["/usr/sbin/sshd", "-D"]
33 changes: 33 additions & 0 deletions cuda-ssh/cuda_v10.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/kaixhin/cuda-ssh.svg)](https://hub.docker.com/r/kaixhin/cuda-ssh/)
[![Docker Stars](https://img.shields.io/docker/stars/kaixhin/cuda-ssh.svg)](https://hub.docker.com/r/kaixhin/cuda-ssh/)

cuda-ssh
========
Ubuntu Core 16.04 + [CUDA 10.1](http://www.nvidia.com/object/cuda_home_new.html) + SSH server + X server (for NVIDIA Visual Profiler).

Requirements
------------

- [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker) - see [requirements](https://github.com/NVIDIA/nvidia-docker/wiki/CUDA#requirements) for more details.

Build
-----
Include password.txt with the password for sshd (by default this is "password").

Usage
-----
Use NVIDIA Docker: ``nvidia-docker run -dP kaixhin/cuda-ssh``.

The default password should be changed. To do so start up a container and then run `docker exec <id> bash -c "echo 'root:<password>' | chpasswd"`.

For automatically mapping a SSH port use ``nvidia-docker run -dP kaixhin/cuda-ssh`` and `docker port <id>` to retrieve the port.
For specifying the port manually use ``nvidia-docker run -d -p <port>:22 kaixhin/cuda-ssh``.
The shell can be entered as usual using ``nvidia-docker run -it kaixhin/cuda-ssh bash``.

The NVIDIA Visual Profiler (`nvvp`) can be accessed with an X client, after having run ssh with the `-X` flag.

For more information on CUDA on Docker, see the [repo readme](https://github.com/Kaixhin/dockerfiles#cuda).

Citation
--------
If you find this useful in research please consider [citing this work](https://github.com/Kaixhin/dockerfiles/blob/master/CITATION.md).
1 change: 1 addition & 0 deletions cuda-ssh/cuda_v10.1/password.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
password

0 comments on commit 6889470

Please sign in to comment.