Last active
October 25, 2016 23:13
-
-
Save johndpope/01a74ffb93921df48e334097117be1b3 to your computer and use it in GitHub Desktop.
Dockerfile for dev swift3 + ubuntu + sshd + zsh
This file contains hidden or 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
FROM swiftdocker/swift | |
MAINTAINER John Pope <jp at fieldstormapp dot com> | |
# Set Environment Variables & Language Environment | |
ENV HOME /root | |
RUN locale-gen en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US:en | |
ENV LC_ALL en_US.UTF-8 | |
RUN apt-get update && apt-get -y install openssh-server supervisor unzip pkg-config | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:alpine' | chpasswd | |
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# for CGRPC building | |
RUN apt-get install -y build-essential autoconf libtool python-all-dev python-virtualenv zlib1g-dev libc++-dev libc++abi-dev | |
# Install Basic Packages | |
RUN apt-get install -y nano tmux colord zsh emacs | |
# RVM - Ruby Version Manager / bundler / Gemfiles | |
RUN curl -sSL https://get.rvm.io | bash | |
RUN source /etc/profile.d/rvm.sh | |
RUN rvm install ruby-2.2.3 | |
RUN gem install rvm | |
#install ZSH | |
RUN git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \ | |
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \ | |
&& chsh -s /bin/zsh | |
RUN TERM=xterm-256color | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
ENV NOTVISIBLE "in users profile" | |
RUN echo "export VISIBLE=now" >> /etc/profile | |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
EXPOSE 22 | |
CMD ["/usr/bin/supervisord"] | |
# CMD ["zsh"] | |
# docker build -t swift3-ssh . | |
# https://github.com/swiftdocker/docker-swift/issues/9#issuecomment-162172540 | |
# sudo docker run --security-opt seccomp=unconfined -p 2222:22 -i -t swift3-ssh | |
# docker ps # find container id | |
# docker exec -it <containerid> /usr/bin/zsh |
This file contains hidden or 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
[supervisord] | |
nodaemon=true | |
[program:sshd] | |
command=/usr/sbin/sshd -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use commands in comments to build image / start ssh / attach to container.

With UTF settings + ZSH - your linux console should look like this.
You can now connect via to 0.0.0.0:2222 with root + alpine password using Cyberduck
Edit files on host /osx - then drag and drop
