Last active
August 29, 2015 14:25
-
-
Save pdxjohnny/0ae3d5b2eba388829c03 to your computer and use it in GitHub Desktop.
X11 and Openssh server in a container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# VERSION: 0.1 | |
# DESCRIPTION: X11 and Openssh server in a container | |
# AUTHOR: John Andersen <johnandersenpdx@gmail.com> | |
# COMMENTS: | |
# This file builds a container which can be accessed via ssh | |
# with username=user password=user. Usefull as a base image | |
# for a conatiner which whishes to install gui software | |
# USAGE: | |
# # Download x11 Dockerfile | |
# wget https://gist.githubusercontent.com/pdxjohnny/0ae3d5b2eba388829c03/raw/b12c5e5e89ad80400f73c38ce464a672378572d0/Dockerfile | |
# | |
# # Build x11 image | |
# docker build -t x11 . | |
# | |
# # Run x11 container | |
# docker run -d -P --name test x11 | |
# docker port test 22 | |
# ssh -X -oStrictHostKeyChecking=no user@localhost -p 32771 xeyes #password is user | |
FROM debian:8 | |
MAINTAINER John Andersen | |
RUN apt-get update -y && \ | |
apt-get install -qqy openssh-server x11-apps && \ | |
apt-get clean && \ | |
rm -rf /var/cache/apt/* && \ | |
mkdir /var/run/sshd && \ | |
/usr/sbin/useradd user && \ | |
echo "user:user" | chpasswd && \ | |
mkdir home/user && \ | |
chown user:user /home/user/ | |
ENV DISPLAY :0 | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment