From 0a893aaa369780c3d595f3fee37886710266ca6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Carranza=20V=C3=A9lez?= Date: Tue, 6 Oct 2015 14:32:19 +0000 Subject: [PATCH] Make dind use debian instead of resin-base --- tools/dind/Dockerfile | 76 ++++++++++++++++++++++-- tools/dind/config/01_buildconfig | 5 ++ tools/dind/config/01_nodoc | 9 +++ tools/dind/config/services/confd.service | 12 ++++ 4 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 tools/dind/config/01_buildconfig create mode 100644 tools/dind/config/01_nodoc create mode 100644 tools/dind/config/services/confd.service diff --git a/tools/dind/Dockerfile b/tools/dind/Dockerfile index d42d36df..20aec520 100644 --- a/tools/dind/Dockerfile +++ b/tools/dind/Dockerfile @@ -1,17 +1,81 @@ -FROM resin/resin-base:e47ff33 +FROM debian:jessie VOLUME /var/lib/docker VOLUME /resin-data +ENV DEBIAN_FRONTEND noninteractive +ENV TERM xterm ENV DOCKER_VERSION 1.6.2 +COPY ./config/01_nodoc /etc/dpkg/dpkg.cfg.d/ +COPY ./config/01_buildconfig /etc/apt/apt.conf.d/ + +RUN apt-get update \ + && apt-get dist-upgrade \ + && apt-get install -y \ + apt-transport-https \ + build-essential \ + ca-certificates \ + curl \ + dbus \ + git \ + htop \ + iptables \ + less \ + libpq-dev \ + libsqlite3-dev \ + jq \ + nano \ + netcat \ + ifupdown \ + openssh-client \ + openssh-server \ + openvpn \ + parted \ + python \ + python-dev \ + rsyslog \ + rsyslog-gnutls \ + socat \ + vim \ + wget \ + && rm -rf /var/lib/apt/lists/* + +ENV CONFD_VERSION 0.10.0 + +RUN wget -O /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 \ + && chmod a+x /usr/local/bin/confd \ + && ln -s /usr/src/app/config/confd /etc/confd + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# systemd configuration + +ENV container lxc + +# We never want these to run in a container +RUN systemctl mask \ + dev-hugepages.mount \ + dev-mqueue.mount \ + sys-fs-fuse-connections.mount \ + sys-kernel-config.mount \ + sys-kernel-debug.mount \ + + display-manager.service \ + getty@.service \ + systemd-logind.service \ + systemd-remount-fs.service \ + + getty.target \ + graphical.target + +RUN systemctl disable ssh.service + # From get.docker.com script RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 \ && echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list \ - && apt-get update && apt-get install lxc-docker-${DOCKER_VERSION} \ - && rm -rf /var/lib/apt/lists/* - -RUN apt-get update && apt-get install jq socat\ + && apt-get update && apt-get install -y lxc-docker-${DOCKER_VERSION} \ && rm -rf /var/lib/apt/lists/* COPY config/openvpn/ /etc/openvpn/ @@ -19,3 +83,5 @@ COPY config/services/ /etc/systemd/system/ COPY resin-vars vpn-init /usr/src/app/ RUN systemctl enable resin-supervisor-dind + +CMD env > /etc/docker.env; exec /sbin/init \ No newline at end of file diff --git a/tools/dind/config/01_buildconfig b/tools/dind/config/01_buildconfig new file mode 100644 index 00000000..15dcac99 --- /dev/null +++ b/tools/dind/config/01_buildconfig @@ -0,0 +1,5 @@ +APT::Get::Assume-Yes "true"; +APT::Get::force-yes "true"; +APT::Install-Recommends "0"; +APT::Install-Suggests "0"; +quiet "true"; diff --git a/tools/dind/config/01_nodoc b/tools/dind/config/01_nodoc new file mode 100644 index 00000000..da9b09e7 --- /dev/null +++ b/tools/dind/config/01_nodoc @@ -0,0 +1,9 @@ +path-exclude /usr/share/doc/* +path-exclude /usr/share/man/* +path-exclude /usr/share/groff/* +path-exclude /usr/share/info/* +path-exclude /usr/share/lintian/* +path-exclude /usr/share/linda/* + +path-exclude /usr/share/locale/* +path-include /usr/share/locale/en* diff --git a/tools/dind/config/services/confd.service b/tools/dind/config/services/confd.service new file mode 100644 index 00000000..0fb7a1bc --- /dev/null +++ b/tools/dind/config/services/confd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Confd +Before=rsyslog.service + +[Service] +Type=oneshot +EnvironmentFile=/etc/docker.env +ExecStart=-/usr/local/bin/confd -onetime -confdir=/etc/confd -backend=env +ExecStart=-/usr/local/bin/confd -onetime -confdir=/etc/confd -node=http://172.17.42.1:4001 + +[Install] +WantedBy=basic.target