-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (41 loc) · 1.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:12.04
MAINTAINER John Albietz "[email protected]"
RUN \
`# ubuntu sources.list setup`; \
echo deb http://archive.ubuntu.com/ubuntu precise main > /etc/apt/sources.list; \
echo deb http://archive.ubuntu.com/ubuntu precise universe multiverse >> /etc/apt/sources.list; \
echo deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe >> /etc/apt/sources.list; \
echo deb http://security.ubuntu.com/ubuntu precise-security main restricted universe >> /etc/apt/sources.list; \
\
`# prevent udev, initscripts and upstart from being updated with apt-get update`; \
echo udev hold | dpkg --set-selections; \
echo initscripts hold | dpkg --set-selections; \
echo upstart hold | dpkg --set-selections;
RUN \
`# update packages in this layer`; \
apt-get update; \
apt-get -y -u upgrade --no-install-recommends; \
\
`# https support for apt`; \
apt-get -y install apt-transport-https; \
\
`# fix apt issue: https://github.com/dotcloud/docker/issues/1024`; \
dpkg-divert --local --rename --add /sbin/initctl; \
ln -sf /bin/true /sbin/initctl; \
\
`# disable ipv6`; \
echo 'net.ipv6.conf.default.disable_ipv6 = 1' > /etc/sysctl.d/20-ipv6-disable.conf; \
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.d/20-ipv6-disable.conf; \
echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.d/20-ipv6-disable.conf; \
cat /etc/sysctl.d/20-ipv6-disable.conf; \
sysctl -p; \
\
`# setup ubuntu user and set default passwords`; \
useradd -d /home/ubuntu -m ubuntu -s /bin/bash -c "ubuntu user"; \
adduser ubuntu sudo; \
echo 'ubuntu:ubuntu' | chpasswd; \
echo 'root:root' | chpasswd;
\
`# remove cached packages`; \
apt-get clean;
CMD ["/bin/bash"]