Install (Debian) ---------------- (als root) aptitude update aptitude remove docker docker-engine docker.io aptitude install apt-transport-https ca-certificates curl gnupg2 software-properties-common curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add - apt-key fingerprint | grep -A 3 0EBFCD88 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" aptitude update aptitude install docker-ce Install (Ubuntu) ---------------- (als root) apt-get remove docker docker-engine docker.io sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get update sudo apt-get install docker-ce Dockerfile (date) ----------------- FROM ubuntu:latest MAINTAINER hans.wurst@example.com CMD ["date"] Dockerfile (nginx_hallo_welt Version 1) --------------------------------------- FROM ubuntu:latest MAINTAINER hans.wurst@example.com ENV DEBIAN_FRONTEND noninteractive RUN apt-get update RUN apt-get install -y nginx-light RUN echo "daemon off;" >>/etc/nginx/nginx.conf RUN echo "Hallo Linux-Cafe! Hallo Welt!" > /var/www/html/index.html RUN sed -i /etc/nginx/nginx.conf -e "s/access_log.*/access_log \/dev\/stdout;/" -e "s/error_log.*/error_log \/dev\/stdout info;/" EXPOSE 80 ENTRYPOINT ["/usr/sbin/nginx"] Dockerfile (nginx_hallo_welt Version 2) --------------------------------------- (optimiert, weniger Layers) FROM ubuntu:latest MAINTAINER hans.wurst@example.com ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y nginx-light && apt-get clean RUN echo "daemon off;" >>/etc/nginx/nginx.conf && sed -i /etc/nginx/nginx.conf -e "s/access_log.*/access_log \/dev\/stdout;/" -e "s/error_log.*/error_log \/dev\/stdout info;/" RUN echo "Hallo Linux-Cafe! Hallo Welt!" > /var/www/html/index.html EXPOSE 80 ENTRYPOINT ["/usr/sbin/nginx"]