MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 13 as of 2016-10-03 15:27:30
  • Docker

Docker

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.

http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Developers can use Docker to pack, ship, and run any application as a lightweight, portable, self sufficient LXC container that can run virtually anywhere.

In a nutshell, here's what Docker can do for you: It can get more applications running on the same hardware than other technologies; it makes it easy for developers to quickly create, ready-to-run containered applications; and it makes managing and deploying applications much easier.

http://en.wikipedia.org/wiki/LXC

LXC (Linux Containers) is an operating system–level virtualization method for running multiple isolated Linux systems (containers) on a single control host.

LXC provides operating system-level virtualization through a virtual environment that has its own process and network space, instead of creating a full-fledged virtual machine.

Tutorial

https://www.docker.com/tryit

https://hub.docker.com/

https://docs.docker.com/installation

https://docs.docker.com/articles/basics/

Windows install

https://docs.docker.com/installation/windows/

The Docker Engine uses Linux-specific kernel features, so to run it on Windows we need to use a lightweight virtual machine (vm).

docker run hello-world

Docker SSH container Ubuntu

https://docs.docker.com/examples/running_ssh_service/

In bootDocker create ~/ssh/Dockerfile :

# sshd
#
# VERSION               0.0.2

FROM ubuntu:14.04
MAINTAINER Sven Dowideit <SvenDowideit@docker.com>

RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# 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

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
  • docker build -t eg_sshd .
  • docker run -d -P --name test_sshd eg_sshd
  • docker ps -l
  • ssh root@127.0.0.1 -p49153 # password screencast

  • sudo docker stop test_sshd # stop container test_sshd

Install jdk8 in trusty

  • apt-get install software-properties-common
  • add-apt-repository ppa:openjdk-r/ppa -y
  • apt-get update
  • apt-get install openjdk-8-jdk

Dockerfile

FROM ubuntu:14.04

RUN apt-get update && \
    apt-get install -y traceroute openssh-server software-properties-common mongodb rabbitmq-server  && \
    add-apt-repository ppa:openjdk-r/ppa -y && \
    apt-get update && \
    apt-get install -y openjdk-8-jdk

RUN mkdir /var/run/sshd
RUN echo 'root:12345678' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# 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

EXPOSE 22 8080 8081 8082 5672 15672 27017 80
CMD ["/usr/sbin/sshd", "-D"]
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01