Skip to content

Instantly share code, notes, and snippets.

@patriksvensson
Created November 21, 2015 15:15
Show Gist options
  • Save patriksvensson/6401d97eda1e36edc7b2 to your computer and use it in GitHub Desktop.
Save patriksvensson/6401d97eda1e36edc7b2 to your computer and use it in GitHub Desktop.
Dockerfile for Jenkins build agent using Cake
FROM ubuntu:15.10
MAINTAINER Patrik Svensson "patrik@patriksvensson.se"
# Make sure everything is up to date.
RUN apt-get update
RUN apt-get -y upgrade
# Install SSH server.
RUN apt-get install -y openssh-server
RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd
RUN mkdir -p /var/run/sshd
# Install prereqs
RUN apt-get install -y openjdk-7-jdk
RUN apt-get install -y git-all
RUN apt-get install -y curl
RUN apt-get install -y unzip
# Install Mono
RUN curl -s http://download.mono-project.com/repo/xamarin.gpg | apt-key add -
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
RUN apt-get update && apt-get install -y mono-complete
# Create Jenkins user
RUN adduser --quiet jenkins
RUN echo "jenkins:jenkins" | chpasswd
# Install certificates
RUN mozroots --import --machine --sync --quiet
RUN yes | certmgr -ssl -m https://go.microsoft.com
RUN yes | certmgr -ssl -m https://nugetgallery.blob.core.windows.net
RUN yes | certmgr -ssl -m https://nuget.org
# Expose SSH port.
EXPOSE 22
# Run SSH agent as daemon.
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment