Skip to content

Instantly share code, notes, and snippets.

@vmwarecode
Created November 25, 2015 10:56
Show Gist options
  • Save vmwarecode/b880b6a61b7582442ff8 to your computer and use it in GitHub Desktop.
Save vmwarecode/b880b6a61b7582442ff8 to your computer and use it in GitHub Desktop.
Docker image to run pyvmomi
FROM ubuntu:trusty
MAINTAINER Lino Telera Linoproject.net <[email protected]>
# Install base packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install \
python \
python-pip python-dev build-essential \
openssh-server
RUN pip install --upgrade pip
RUN pip install --upgrade virtualenv
## SSL python connectons
RUN pip install requests[security]
RUN pip install pyopenssl ndg-httpsclient pyasn1
## SSH settings
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
## Working directory
RUN mkdir /opt/pythoncode
EXPOSE 22
WORKDIR /opt/pythoncode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment