Skip to content

Instantly share code, notes, and snippets.

@justnom
Last active August 29, 2015 14:20
Show Gist options
  • Save justnom/501aa9450b130c24b70a to your computer and use it in GitHub Desktop.
Save justnom/501aa9450b130c24b70a to your computer and use it in GitHub Desktop.
Docker Jenkins slave
FROM phusion/baseimage:0.9.16
CMD ["/sbin/my_init"]
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && \
echo "mysql-server mysql-server/root_password password root" | debconf-set-selections && \
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections && \
apt-get install -y php5-cli php5-curl php5-gd php5-mcrypt php5-memcache php5-mysql php5-intl mysql-server-5.5 openjdk-7-jdk && \
mkdir /etc/service/mysql && printf "#!/bin/bash\nexec /usr/bin/mysqld_safe" > /etc/service/mysql/run && chmod +x /etc/service/mysql/run && \
sed -ie 's|bind-address.*|bind-address = 0.0.0.0|g' /etc/mysql/my.cnf && \
adduser --quiet jenkins && echo "jenkins:jenkins" | chpasswd && \
mkdir /home/jenkins/.ssh && echo "SSH_PUB_KEY_HERE" > /home/jenkins/.ssh/authorized_keys && \
rm -f /etc/service/sshd/down && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment