Skip to content

Instantly share code, notes, and snippets.

@yesoreyeram
Last active July 25, 2017 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesoreyeram/52abf549ca4fcdf748a432be82056cfa to your computer and use it in GitHub Desktop.
Save yesoreyeram/52abf549ca4fcdf748a432be82056cfa to your computer and use it in GitHub Desktop.
Ubuntu Docker file with OMI, DSC and SSH

Build : docker build -t myubuntu:latest .

Run: docker run -d --name ubuntu1 -p 25986:5986 myubuntu:latest

Connect: docker exec -it myubuntu bash

Clean: docker stop myubuntu && docker rm myubuntu

FROM ubuntu:16.04
MAINTAINER Sriramajeyam Sugumaran "http://sriramajeyam.com"
SHELL ["/bin/sh", "-c"]
RUN apt-get update -y
RUN apt-get install -y openssh-server rpm libpam0g-dev libkrb5-dev wget openssl python libcurl4-gnutls-dev cron sudo nano
RUN mkdir /tmp/installation
ADD ./packages/packages-microsoft-prod.deb /tmp/installation/
ADD ./packages/omi-1.1.0.ssl_100.x64.deb /tmp/installation/
ADD ./packages/dsc-1.1.1-294.ssl_100.x64.deb /tmp/installation/
ADD ./start.sh /tmp/installation/
RUN mkdir /var/run/sshd
RUN echo 'root:root' |chpasswd
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN dpkg -i /tmp/installation/packages-microsoft-prod.deb
ENV RUNLEVEL=1
RUN dpkg -i /tmp/installation/omi-1.1.0.ssl_100.x64.deb
RUN /opt/omi/bin/omiconfigeditor httpport -a 5985 < /etc/opt/omi/conf/omiserver.conf>tmp.conf && mv -f tmp.conf /etc/opt/omi/conf/omiserver.conf
RUN /opt/omi/bin/omiconfigeditor httpsport -a 5986 < /etc/opt/omi/conf/omiserver.conf>tmp.conf && mv -f tmp.conf /etc/opt/omi/conf/omiserver.conf
RUN dpkg -i /tmp/installation/dsc-1.1.1-294.ssl_100.x64.deb
WORKDIR /tmp/installation
EXPOSE 22 5985 5986
ENTRYPOINT ["/bin/sh","/tmp/installation/start.sh"]
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment