Skip to content

Docker image that can be SSHed in(Ubuntu14.04)

   

For Ansible practice, I wrote this because I wanted an image that can be entered by SSH.

Click here for CentOS7 Click here for CentOS6

Reference Docker 初心者 — ssh で接続できるサーバーを立てる

$ docker build -t ssh_ubuntu14:latest . --no-cache
$ docker run -d -p 2222:22 ssh_ubuntu14:latest
$ ssh-keygen -R [localhost]:2222
$ ssh -p 2222 kabigon@localhost
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
# ユーザー作成
RUN useradd kabigon
RUN echo 'kabigon:password' |chpasswd
RUN echo "kabigon ALL=(ALL) ALL" >> /etc/sudoers
RUN mkdir /home/kabigon
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
view raw Dockerfile hosted with ❤ by GitHub

  1. Obtaining JSON from the API using Alamofire(Swift4.2)
  2. Renaming a project in Xcode10
  3. Creating a Group Style TableView
  4. Getting the SafeArea
  5. Read barcodes in iOS
  6. Search with SearchBar in CollectionView
  7. Implementing a flowing background