From 4c375ace67dff906d729f90c2dae92eb3d522d76 Mon Sep 17 00:00:00 2001 From: Erle Pereira Date: Wed, 8 Apr 2015 22:28:10 +1000 Subject: [PATCH 1/2] Updated Cfengine repo fixed apt-get automated config setting, uses DEBIAN_FRONTEND=noninteractive to avoid a TERM, Dialog error --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c82210..aa8c6dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,24 @@ FROM ubuntu MAINTAINER Eystein Måløy Stenberg -RUN apt-get -y install wget lsb-release unzip +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wget lsb-release unzip ca-certificates # install latest CFEngine RUN wget -qO- http://cfengine.com/pub/gpg.key | apt-key add - -RUN echo "deb http://cfengine.com/pub/apt $(lsb_release -cs) main" > /etc/apt/sources.list.d/cfengine-community.list -RUN apt-get update -RUN apt-get install cfengine-community +#RUN echo "deb http://cfengine.com/pub/apt $(lsb_release -cs) main" > /etc/apt/sources.list.d/cfengine-community.list +RUN echo "deb http://cfengine.com/pub/apt/packages stable main" > /etc/apt/sources.list.d/cfengine-community.list +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cfengine-community # install cfe-docker process management policy -RUN wget --no-check-certificate https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/ +RUN wget https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/ RUN cp /tmp/cfe-docker-master/cfengine/bin/* /var/cfengine/bin/ RUN cp /tmp/cfe-docker-master/cfengine/inputs/* /var/cfengine/inputs/ RUN rm -rf /tmp/cfe-docker-master /tmp/master.zip # apache2 and openssh are just for testing purposes, install your own apps here -RUN apt-get -y install openssh-server apache2 +RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server apache2 RUN mkdir -p /var/run/sshd RUN echo "root:password" | chpasswd # need a password for ssh ENTRYPOINT ["/var/cfengine/bin/docker_processes_run.sh"] + From 23c975e78f09ff3524cf6cfc1a94685af020770b Mon Sep 17 00:00:00 2001 From: Erle Pereira Date: Fri, 10 Apr 2015 20:39:40 +1000 Subject: [PATCH 2/2] Uses ENV to set environment, less errors & warnings Uses COPY syntax to copy files instead of fetching from a repository RUN commands changed to array syntax --- Dockerfile | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa8c6dd..e9cf6ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,28 @@ FROM ubuntu MAINTAINER Eystein Måløy Stenberg +ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wget lsb-release unzip ca-certificates +RUN ["apt-get", "update"] +RUN ["apt-get", "install", "-y", "wget", "unzip", "ca-certificates"] # install latest CFEngine RUN wget -qO- http://cfengine.com/pub/gpg.key | apt-key add - -#RUN echo "deb http://cfengine.com/pub/apt $(lsb_release -cs) main" > /etc/apt/sources.list.d/cfengine-community.list RUN echo "deb http://cfengine.com/pub/apt/packages stable main" > /etc/apt/sources.list.d/cfengine-community.list -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cfengine-community +RUN ["apt-get", "update"] +RUN ["apt-get", "install", "-y", "cfengine-community"] -# install cfe-docker process management policy -RUN wget https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/ -RUN cp /tmp/cfe-docker-master/cfengine/bin/* /var/cfengine/bin/ -RUN cp /tmp/cfe-docker-master/cfengine/inputs/* /var/cfengine/inputs/ -RUN rm -rf /tmp/cfe-docker-master /tmp/master.zip +# install cfe-docker process management policy, from files in this directory +COPY cfengine /var/cfengine + +# -- Alternately get them from another repo +#RUN wget https://github.com/estenberg/cfe-docker/archive/master.zip -P /tmp/ && unzip /tmp/master.zip -d /tmp/ +#RUN cp /tmp/cfe-docker-master/cfengine/bin/* /var/cfengine/bin/ +#RUN cp /tmp/cfe-docker-master/cfengine/inputs/* /var/cfengine/inputs/ +#RUN rm -rf /tmp/cfe-docker-master /tmp/master.zip # apache2 and openssh are just for testing purposes, install your own apps here -RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server apache2 +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server apache2 +RUN ["apt-get", "install", "-y", "openssh-server", "apache2"] RUN mkdir -p /var/run/sshd RUN echo "root:password" | chpasswd # need a password for ssh