-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ubuntu_1204_fix_travis_builds'
- Loading branch information
Showing
3 changed files
with
84 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM ubuntu:12.04 | ||
|
||
# much of this was gleaned from https://github.com/lxc/lxc/blob/lxc-0.8.0/templates/lxc-ubuntu.in | ||
# and then heavily modified and hacked like crazy | ||
|
||
# we're going to want this bad boy installed so we can connect :) | ||
RUN apt-get update && apt-get install -y ssh python | ||
|
||
ADD builds/init-fake.conf /etc/init/fake-container-events.conf | ||
|
||
# undo some leet hax of the base image | ||
RUN rm /usr/sbin/policy-rc.d; \ | ||
rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl | ||
|
||
# generate a nice UTF-8 locale for our use | ||
RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8 | ||
|
||
# remove some pointless services | ||
RUN /usr/sbin/update-rc.d -f ondemand remove; \ | ||
for f in \ | ||
/etc/init/u*.conf \ | ||
/etc/init/mounted-dev.conf \ | ||
/etc/init/mounted-proc.conf \ | ||
/etc/init/mounted-run.conf \ | ||
/etc/init/mounted-tmp.conf \ | ||
/etc/init/mounted-var.conf \ | ||
/etc/init/hostname.conf \ | ||
/etc/init/networking.conf \ | ||
/etc/init/tty*.conf \ | ||
/etc/init/plymouth*.conf \ | ||
/etc/init/hwclock*.conf \ | ||
/etc/init/module*.conf\ | ||
; do \ | ||
dpkg-divert --local --rename --add "$f"; \ | ||
done; \ | ||
echo '# /lib/init/fstab: cleared out for bare-bones Docker' > /lib/init/fstab | ||
|
||
# small fix for SSH in 13.10 (that's harmless everywhere else) | ||
RUN sed -ri 's/^session\s+required\s+pam_loginuid.so$/session optional pam_loginuid.so/' /etc/pam.d/sshd | ||
|
||
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
|
||
# let Upstart know it's in a container | ||
ENV container docker | ||
|
||
# set a cheap, simple password for great convenience | ||
RUN echo 'root:docker.io' | chpasswd | ||
|
||
# we can has SSH | ||
EXPOSE 22 | ||
|
||
# pepare for takeoff | ||
CMD ["/sbin/init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# fake some events needed for correct startup other services | ||
|
||
description "In-Container Upstart Fake Events" | ||
|
||
start on startup | ||
|
||
script | ||
rm -rf /var/run/*.pid | ||
rm -rf /var/run/network/* | ||
/sbin/initctl emit stopped JOB=udevtrigger --no-wait | ||
/sbin/initctl emit started JOB=udev --no-wait | ||
/sbin/initctl emit runlevel RUNLEVEL=3 --no-wait | ||
end script |