From 0e956d6d45d56ff8fbd2444ee28883970e94b6d9 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:08:34 -0500 Subject: [PATCH 01/39] Created a Dockerfile based on the latest Ubuntu 14.04 image. Edited README.rst to reflect those changes. Changed username in nikola. modified: Dockerfile modified: README.rst modified: nikola --- Dockerfile | 60 +++++++++++++++++++++--------------------------------- README.rst | 36 +++++++++++++++++++++++--------- nikola | 2 +- 3 files changed, 50 insertions(+), 48 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77a0197..e7851f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,34 @@ -# build command: -# docker build -t rbrewer123/nikola . +FROM ubuntu:14.04 -FROM nfnty/arch-mini - -# add pkgbuilder repo -RUN echo '' >>/etc/pacman.conf -RUN echo '[pkgbuilder]' >>/etc/pacman.conf -RUN echo 'Server = https://pkgbuilder-repo.chriswarrick.com/' >>/etc/pacman.conf - -# gnupg bugfix -RUN mkdir -p /root/.gnupg && \ - touch /root/.gnupg/dirmngr_ldapservers.conf - -RUN pacman-key -r 5EAAEA16 -RUN pacman-key --lsign 5EAAEA16 - -RUN pacman -Syu --needed --noconfirm \ - base-devel \ - pkgbuilder \ - python-webassets +ENV DEBIAN_FRONTEND noninteractive RUN echo 'en_US.UTF-8 UTF-8' >>/etc/locale.gen RUN echo 'en_DK.UTF-8 UTF-8' >>/etc/locale.gen RUN locale-gen -RUN echo 'user ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/user -RUN useradd -m user - -USER user -WORKDIR /home/user - -RUN pkgbuilder --noconfirm \ - python-pygal \ - python-pyphen \ - python-typogrify - -RUN pkgbuilder --noconfirm \ - python-nikola - USER root -WORKDIR /root -RUN userdel user -RUN rm -rf /home/user +RUN apt-get update && apt-get install -y \ + -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ +build-essential \ +python3-dev \ +python-virtualenv \ +python3-pip \ +python3-wheel \ +libffi-dev \ +libssl-dev \ +libgtk2.0-0 \ +libSM6 \ +libxt6 \ +libgpm2 \ +libxml2-dev \ +libxslt1-dev \ +libjpeg8 \ +libjpeg62-dev \ +libfreetype6 \ +libfreetype6-dev + +RUN pip3 install nikola COPY runasuser.sh /root/ RUN chmod a+x /root/runasuser.sh diff --git a/README.rst b/README.rst index 32644f8..5353b4a 100644 --- a/README.rst +++ b/README.rst @@ -5,10 +5,9 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola -`_ environment based on the latest official Arch -package produced by the Nikola team. This works in docker even if your -host system is not running Arch. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, python developer packages, and the latest nikola package installed with pip3. + +This works in docker even if your host system is not running Ubuntu 14.04. Requirements @@ -16,11 +15,11 @@ Requirements This is tested with the following software: -* Nikola 7.7.2 -* docker 1.8.0 (running on Ubuntu 14.04) +* Nikola 7.7.3 +* Docker version 1.8.3, build f4bf5c7 -Since it's main dependency is docker, it should run on any platform with -docker installed (e.g. Windows, OS X). It may or may not work with earlier +Since its main dependency is Docker, it should run on any platform with +Docker installed (e.g. Windows, OS X). It may or may not work with earlier versions of docker. To install docker on your system, see the official `docker installation instructions `_. @@ -30,7 +29,7 @@ Installation To build the docker image:: - $ docker build -t rbrewer123/nikola github.com/rbrewer123/docker_nikola + $ docker build -t dmmmdfll/nikola github.com/dmmmdfll/docker_nikola You can see your new image with this command:: @@ -38,7 +37,7 @@ You can see your new image with this command:: Grab the ``go`` script from github like this:: - $ git clone https://github.com/rbrewer123/docker_nikola + $ git clone https://github.com/dmmmdfll/docker_nikola Now update the ``docker_nikola/nikola`` script to use your correct ``username``, ``uid``, ``group``, and ``gid``. This avoids problems with @@ -57,6 +56,23 @@ To run ``nikola`` from within the container, simply run the ``nikola`` script:: Limitations ############# +The package nikola is installed with `pip3 install nikola` inside the image. + +Some warnings are generated on `nikola build`: + +* WARNING: Nikola: In order to hyphenate texts, you must install the "pyphen" Python package. + +* …more warnings + +I decided that the warnings would likely be resolved by running `pip3 install nikola[extras]`. + +I tried that. + +Nikola exited fatally with exceptions that I did not fully understand. The exception had something to do with not being able to find the hyphenation dictionary and that the install could not be in .local. + +I need to do some more research to sort out for myself what is going on before trying to guess at a fix. + +**I have not tried this. I am leaving this comment from forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** The only limitation I know of so far is using Nikola`s ``deploy`` command. I'm using Nikola with Amazon S3, and the ``s3cmd`` I use to deploy my site is not within the Nikola container. Since it's a single command to deploy diff --git a/nikola b/nikola index 46a6b22..4658526 100755 --- a/nikola +++ b/nikola @@ -1,4 +1,4 @@ #!/bin/bash # run the container as a user to simplify writing files outside the container -docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) -p 8000:8000 rbrewer123/nikola -U rbrewer -u 1000 -G rbrewer -g 1000 nikola "$@" +docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) -p 8000:8000 dmmmdfll/nikola -U ubuntu -u 1000 -G ubuntu -g 1000 nikola "$@" From a897a7fdbead77195188e1264ae52b0f53d36bee Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:19:19 -0500 Subject: [PATCH 02/39] Minor changes to README. modified: README.rst --- README.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 5353b4a..5fa8e40 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,9 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, python developer packages, and the latest nikola package installed with pip3. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, Python developer packages, and the latest Nikola package installed with pip3. + + pip3 install nikola This works in docker even if your host system is not running Ubuntu 14.04. @@ -56,15 +58,19 @@ To run ``nikola`` from within the container, simply run the ``nikola`` script:: Limitations ############# -The package nikola is installed with `pip3 install nikola` inside the image. +The package nikola is installed with + + `pip3 install nikola` + +inside the image. -Some warnings are generated on `nikola build`: +Some warnings are generated on ``nikola build``: * WARNING: Nikola: In order to hyphenate texts, you must install the "pyphen" Python package. * …more warnings -I decided that the warnings would likely be resolved by running `pip3 install nikola[extras]`. +I decided that the warnings would likely be resolved by running ``pip3 install nikola[extras]``. I tried that. From e1d7cef318cd6c2b5d617db8c63adf4f928eac03 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:21:31 -0500 Subject: [PATCH 03/39] Minor edits. modified: README.rst --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 5fa8e40..8a61e98 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ Purpose This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, Python developer packages, and the latest Nikola package installed with pip3. - pip3 install nikola + ``pip3 install nikola`` This works in docker even if your host system is not running Ubuntu 14.04. @@ -60,7 +60,7 @@ Limitations The package nikola is installed with - `pip3 install nikola` + ``pip3 install nikola`` inside the image. From 6eaefdd6c48f8aa2c34256e2d3084bfdaaffdcd6 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:22:27 -0500 Subject: [PATCH 04/39] minor edits to README --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 8a61e98..1d8dcea 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,7 @@ Nikola exited fatally with exceptions that I did not fully understand. The exce I need to do some more research to sort out for myself what is going on before trying to guess at a fix. **I have not tried this. I am leaving this comment from forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** + The only limitation I know of so far is using Nikola`s ``deploy`` command. I'm using Nikola with Amazon S3, and the ``s3cmd`` I use to deploy my site is not within the Nikola container. Since it's a single command to deploy From 85859d407294bea5d6fdf925e7b6e41f2fce1da0 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:23:54 -0500 Subject: [PATCH 05/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1d8dcea..120f36e 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Nikola exited fatally with exceptions that I did not fully understand. The exce I need to do some more research to sort out for myself what is going on before trying to guess at a fix. -**I have not tried this. I am leaving this comment from forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** +**I have not tried a deploy. I am leaving the following limitation from forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** The only limitation I know of so far is using Nikola`s ``deploy`` command. I'm using Nikola with Amazon S3, and the ``s3cmd`` I use to deploy my site From 3852797c951333ff16ad362ee0876493f4f9c97f Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 09:24:27 -0500 Subject: [PATCH 06/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 120f36e..bbece13 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Nikola exited fatally with exceptions that I did not fully understand. The exce I need to do some more research to sort out for myself what is going on before trying to guess at a fix. -**I have not tried a deploy. I am leaving the following limitation from forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** +**I have not tried a deploy. I am leaving the following limitation from the forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** The only limitation I know of so far is using Nikola`s ``deploy`` command. I'm using Nikola with Amazon S3, and the ``s3cmd`` I use to deploy my site From 2075b89ad608e3c062042edc9f793cb46301d2d6 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 12:07:41 -0500 Subject: [PATCH 07/39] After consulting the Nikola Handbook, I decided to try installing nikola[extras] into a virtualenv. I was able to run the container, enter it, and build a web site without any errors. I think I need to modify ./runasuser.sh now to reflect this change. modified: Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7851f3..db7c60d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,8 +28,8 @@ libjpeg62-dev \ libfreetype6 \ libfreetype6-dev -RUN pip3 install nikola - +RUN \ + ["/bin/bash", "-c", "virtualenv -p /usr/bin/python3 nikola-virtualenv && source /nikola-virtualenv/bin/activate && pip3 install --upgrade Nikola[extras]"] COPY runasuser.sh /root/ RUN chmod a+x /root/runasuser.sh From 74b10a2ec5d6fa4649826b7f451513eb8105893a Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 12:15:13 -0500 Subject: [PATCH 08/39] Installed the nikola[extras] into a virtualenv. Changed the nikola file to reflect the new location of the binary in nikola-virtualenv/bin/nikola modified: nikola --- nikola | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nikola b/nikola index 4658526..823c367 100755 --- a/nikola +++ b/nikola @@ -1,4 +1,4 @@ #!/bin/bash # run the container as a user to simplify writing files outside the container -docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) -p 8000:8000 dmmmdfll/nikola -U ubuntu -u 1000 -G ubuntu -g 1000 nikola "$@" +docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) -p 8000:8000 dmmmdfll/nikola -U ubuntu -u 1000 -G ubuntu -g 1000 /nikola-virtualenv/bin/nikola "$@" From 26ace9aa693b0066470226e3c7d55a57a6e50ae5 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 12:17:47 -0500 Subject: [PATCH 09/39] Edited README to reflect that all features of Nikola working as expected. modified: README.rst --- README.rst | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/README.rst b/README.rst index bbece13..a871e0a 100644 --- a/README.rst +++ b/README.rst @@ -5,9 +5,7 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, Python developer packages, and the latest Nikola package installed with pip3. - - ``pip3 install nikola`` +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, Python developer packages, and the latest Nikola package installed. This works in docker even if your host system is not running Ubuntu 14.04. @@ -58,26 +56,6 @@ To run ``nikola`` from within the container, simply run the ``nikola`` script:: Limitations ############# -The package nikola is installed with - - ``pip3 install nikola`` - -inside the image. - -Some warnings are generated on ``nikola build``: - -* WARNING: Nikola: In order to hyphenate texts, you must install the "pyphen" Python package. - -* …more warnings - -I decided that the warnings would likely be resolved by running ``pip3 install nikola[extras]``. - -I tried that. - -Nikola exited fatally with exceptions that I did not fully understand. The exception had something to do with not being able to find the hyphenation dictionary and that the install could not be in .local. - -I need to do some more research to sort out for myself what is going on before trying to guess at a fix. - **I have not tried a deploy. I am leaving the following limitation from the forked repo at https://github.com/rbrewer123/docker_nikola because it seems likely that the same would be true for this image** The only limitation I know of so far is using Nikola`s ``deploy`` command. From f5c9246f7dcc08e59ed6995685ae63462fd0334d Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 12:20:39 -0500 Subject: [PATCH 10/39] reformatted modified: nikola --- nikola | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nikola b/nikola index 823c367..cbcca16 100755 --- a/nikola +++ b/nikola @@ -1,4 +1,12 @@ #!/bin/bash # run the container as a user to simplify writing files outside the container -docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) -p 8000:8000 dmmmdfll/nikola -U ubuntu -u 1000 -G ubuntu -g 1000 /nikola-virtualenv/bin/nikola "$@" +docker run --rm -it \ + -v $(pwd):$(pwd) \ + -w $(pwd) \ + -p 8000:8000 dmmmdfll/nikola \ + -U ubuntu \ + -u 1000 \ + -G ubuntu \ + -g 1000 \ +/nikola-virtualenv/bin/nikola "$@" From 55edce3991488c0b4d55142765f030c05c3e87f3 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sun, 13 Dec 2015 12:57:22 -0500 Subject: [PATCH 11/39] Uploaded the built image to Docker Hub. Edited to reflect that addition. modified: README.rst --- README.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a871e0a..e1f12c0 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,9 @@ This ``Dockerfile`` creates a sandboxed, runnable `Nikola ` with the command ``docker pull dmmmdfll/nikola``. + + Requirements ################ @@ -27,11 +30,15 @@ versions of docker. To install docker on your system, see the official Installation ############## -To build the docker image:: +To pull the docker image. (This is much faster than building your own. lxml takes at least drinking a cup of coffee's time to build on my machine.):: + + $ docker pull dmmmdfll/nikola + +Alternatively to pulling the docker image build the docker image with:: $ docker build -t dmmmdfll/nikola github.com/dmmmdfll/docker_nikola -You can see your new image with this command:: +You can see your new image that you either pulled or built with this command:: $ docker images From 6b4438d2e124628beb0604e76f4e2ffa58a4ba1e Mon Sep 17 00:00:00 2001 From: dmmmd Date: Mon, 14 Dec 2015 12:30:11 -0500 Subject: [PATCH 12/39] Improved readability with formatting. modified: Dockerfile --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index db7c60d..cea9356 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,11 @@ libfreetype6 \ libfreetype6-dev RUN \ - ["/bin/bash", "-c", "virtualenv -p /usr/bin/python3 nikola-virtualenv && source /nikola-virtualenv/bin/activate && pip3 install --upgrade Nikola[extras]"] + ["/bin/bash", \ + "-c", \ + "virtualenv -p /usr/bin/python3 nikola-virtualenv && \ + source /nikola-virtualenv/bin/activate && \ + pip3 install --upgrade Nikola[extras]"] COPY runasuser.sh /root/ RUN chmod a+x /root/runasuser.sh From e07e8c881d1d4c9716b1fe4357fc073a2c5a69a5 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 06:39:27 -0500 Subject: [PATCH 13/39] Added MAINTAINER to Dockerfile modified: Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index cea9356..4269811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM ubuntu:14.04 +MAINTAINER Don M ENV DEBIAN_FRONTEND noninteractive From 7f0094d9aa5d118241d5173a49910acc29d0fbaa Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 06:41:10 -0500 Subject: [PATCH 14/39] Changed base image to debian as suggested in the dockerfile best practices https://docs.docker.com/engine/articles/dockerfile_best-practices/ modified: Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4269811..14c5d7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM debian MAINTAINER Don M ENV DEBIAN_FRONTEND noninteractive From 36b15a3e69a3b7d683c9559726e5510ce5ed0016 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 06:45:20 -0500 Subject: [PATCH 15/39] added script to build the base with dmmmdfll/nikola/debian tag new file: build-base --- build-base | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 build-base diff --git a/build-base b/build-base new file mode 100755 index 0000000..401ffcf --- /dev/null +++ b/build-base @@ -0,0 +1,3 @@ +docker build \ + -t dmmmdfll/nikola/debian \ + -f Dockerfile .; From df36001a8bb6bd7d07832ffbabffd89a3c54c8b3 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 07:05:25 -0500 Subject: [PATCH 16/39] moved USER position modified: Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 14c5d7f..55e777a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ -FROM debian +FROM debian:stable MAINTAINER Don M ENV DEBIAN_FRONTEND noninteractive +USER root + RUN echo 'en_US.UTF-8 UTF-8' >>/etc/locale.gen RUN echo 'en_DK.UTF-8 UTF-8' >>/etc/locale.gen RUN locale-gen -USER root - RUN apt-get update && apt-get install -y \ -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ build-essential \ From 8a2e44ec25b21c675ef4547ca6d71e1ec0edcaaa Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 07:16:37 -0500 Subject: [PATCH 17/39] Able to set the locale to US English and DK. modified: Dockerfile --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 55e777a..b2004b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,11 @@ ENV DEBIAN_FRONTEND noninteractive USER root -RUN echo 'en_US.UTF-8 UTF-8' >>/etc/locale.gen -RUN echo 'en_DK.UTF-8 UTF-8' >>/etc/locale.gen -RUN locale-gen +RUN apt-get update -qq && apt-get install -y \ +locales -qq && \ +locale-gen en_US.UTF-8 en_us && \ +locale-gen en_DK.UTF-8 en_dk && \ +dpkg-reconfigure locales RUN apt-get update && apt-get install -y \ -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ From 4c0ef776f49a0c36ef720c7827022ae39ed41b32 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 07:18:46 -0500 Subject: [PATCH 18/39] removed jpeg package install modified: Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b2004b3..2ed0972 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,6 @@ libxt6 \ libgpm2 \ libxml2-dev \ libxslt1-dev \ -libjpeg8 \ -libjpeg62-dev \ libfreetype6 \ libfreetype6-dev From 9cb86e324ffa70d7ba63cf7f42705ab377216b03 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 07:40:13 -0500 Subject: [PATCH 19/39] added libjpeg62-turbo-dev to apt-get install list modified: Dockerfile added locale information modified: Dockerfile added GitHub repo url modified: Dockerfile --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ed0972..9a0894b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,17 @@ FROM debian:stable -MAINTAINER Don M +MAINTAINER Don M ENV DEBIAN_FRONTEND noninteractive USER root RUN apt-get update -qq && apt-get install -y \ -locales -qq && \ -locale-gen en_US.UTF-8 en_us && \ -locale-gen en_DK.UTF-8 en_dk && \ -dpkg-reconfigure locales +locales -qq + +RUN echo 'en_US.UTF-8 UTF-8' >>/etc/locale.gen && \ + echo 'en_DK.UTF-8 UTF-8' >>/etc/locale.gen && \ + locale-gen && \ + dpkg-reconfigure locales RUN apt-get update && apt-get install -y \ -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ @@ -26,6 +28,7 @@ libxt6 \ libgpm2 \ libxml2-dev \ libxslt1-dev \ +libjpeg62-turbo-dev \ libfreetype6 \ libfreetype6-dev From f2cc764ce4e4816defbc59109412617f3069ef95 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:29:33 -0500 Subject: [PATCH 20/39] added /nikola-virtualenv/bin to $PATH seem to have fixed the locale env variables properly modified: Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9a0894b..af4f55a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,12 +32,15 @@ libjpeg62-turbo-dev \ libfreetype6 \ libfreetype6-dev +RUN pip3 install virtualenv RUN \ ["/bin/bash", \ "-c", \ "virtualenv -p /usr/bin/python3 nikola-virtualenv && \ source /nikola-virtualenv/bin/activate && \ pip3 install --upgrade Nikola[extras]"] +RUN export PATH=$PATH:/nikola-virtualenv/bin + COPY runasuser.sh /root/ RUN chmod a+x /root/runasuser.sh From de85757b0d0dacde292a0527163da03f1e3b1376 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:31:51 -0500 Subject: [PATCH 21/39] removed python-virtualenv package, install virtualenv with pip3 modified: Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index af4f55a..bab32dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,6 @@ RUN apt-get update && apt-get install -y \ -o APT::Install-Recommends=false -o APT::Install-Suggests=false \ build-essential \ python3-dev \ -python-virtualenv \ python3-pip \ python3-wheel \ libffi-dev \ From cb5e1d3826f6682afe8eaa5b4a15f784dc214789 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:33:29 -0500 Subject: [PATCH 22/39] $PATH properly updated to /nikola-virtualenv/bin so can call `nikola` in nikola script modified: nikola --- nikola | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nikola b/nikola index cbcca16..4452035 100755 --- a/nikola +++ b/nikola @@ -9,4 +9,4 @@ docker run --rm -it \ -u 1000 \ -G ubuntu \ -g 1000 \ -/nikola-virtualenv/bin/nikola "$@" +nikola "$@" From 8e7789be5a8472a2068dadcc4d09ded607a521a7 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:34:10 -0500 Subject: [PATCH 23/39] changed to image name dmmmdfll/nikola/debian modified: nikola --- nikola | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nikola b/nikola index 4452035..d25085c 100755 --- a/nikola +++ b/nikola @@ -4,7 +4,7 @@ docker run --rm -it \ -v $(pwd):$(pwd) \ -w $(pwd) \ - -p 8000:8000 dmmmdfll/nikola \ + -p 8000:8000 dmmmdfll/nikola/debian \ -U ubuntu \ -u 1000 \ -G ubuntu \ From 6d09285bacaf878b3e2d9980597094c6e82305ec Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:34:51 -0500 Subject: [PATCH 24/39] improved formatting modified: nikola --- nikola | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nikola b/nikola index d25085c..724d54e 100755 --- a/nikola +++ b/nikola @@ -4,7 +4,8 @@ docker run --rm -it \ -v $(pwd):$(pwd) \ -w $(pwd) \ - -p 8000:8000 dmmmdfll/nikola/debian \ + -p 8000:8000 \ +dmmmdfll/nikola/debian \ -U ubuntu \ -u 1000 \ -G ubuntu \ From b09bdffe6e856ef83fd94f772cdbf862192e94fc Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:49:14 -0500 Subject: [PATCH 25/39] No more locale warnings when running nikola. debian version of Dockerfile functions as expected modified: nikola --- nikola | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nikola b/nikola index 724d54e..2182c53 100755 --- a/nikola +++ b/nikola @@ -1,6 +1,8 @@ #!/bin/bash -# run the container as a user to simplify writing files outside the container +# modify lines 11-14 with values to suit your environment regarding +# users and groups. This keeps the output files' permissions as expected. +# my username and group on my setup is 'ubuntu' and the ids are 1000, 1000 docker run --rm -it \ -v $(pwd):$(pwd) \ -w $(pwd) \ @@ -10,4 +12,4 @@ dmmmdfll/nikola/debian \ -u 1000 \ -G ubuntu \ -g 1000 \ -nikola "$@" +/nikola-virtualenv/bin/nikola "$@" From 0dce16ac5fad9c364c415ac96d865b4915869da2 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 08:52:02 -0500 Subject: [PATCH 26/39] Haven't figured out yet how to put /nikola-virutalenv/bin on $PATH and make it stick. Leaving nikola script with full path for now. modified: build-base --- build-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-base b/build-base index 401ffcf..8f5b5cb 100755 --- a/build-base +++ b/build-base @@ -1,3 +1,3 @@ docker build \ - -t dmmmdfll/nikola/debian \ + -t dmmmdfll/nikola \ -f Dockerfile .; From 1c8d2dbe623c7978ae1d0224cb6db3a8ab3412ea Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:04:28 -0500 Subject: [PATCH 27/39] Updated to reflect change to debian based image modified: README.rst --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index e1f12c0..bece667 100644 --- a/README.rst +++ b/README.rst @@ -5,13 +5,15 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the latest Ubuntu 14.04 image, Python developer packages, and the latest Nikola package installed. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the debian:stable image, Python developer packages, and the latest Nikola package installed. -This works in docker even if your host system is not running Ubuntu 14.04. +The decision to use debian:stable was influenced by:: -Pull this image from `Docker Hub ` with the command ``docker pull dmmmdfll/nikola``. + `Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. `_ +This image works in docker even if your host system is not running Debian. +Pull this image from `Docker Hub ` with the command ``docker pull dmmmdfll/nikola``. Requirements ################ From b566b6ba795a74dc651a843f326f31589eaa5cfe Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:06:31 -0500 Subject: [PATCH 28/39] trying to fix a link for Docker best practices modified: README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index bece667..7c01064 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ +`Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. `_ This image works in docker even if your host system is not running Debian. From e0a6c4738fed569cdcf80a341818ca0319a35ffa Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:07:20 -0500 Subject: [PATCH 29/39] trying to fix a link in rst modified: README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 7c01064..11b1ed8 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ + Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. This image works in docker even if your host system is not running Debian. From 0ec08f07ab9b4b9d0b006a19397acb3ee7bc949f Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:10:43 -0500 Subject: [PATCH 30/39] fixing block quote --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 11b1ed8..c37aa2f 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ This ``Dockerfile`` creates a sandboxed, runnable `Nikola +> Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. This image works in docker even if your host system is not running Debian. From 1a4ae9c189a235e3ba30df709c858c4884e982e8 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:12:00 -0500 Subject: [PATCH 31/39] fixing block quote --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index c37aa2f..0903559 100644 --- a/README.rst +++ b/README.rst @@ -7,9 +7,9 @@ Purpose This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the debian:stable image, Python developer packages, and the latest Nikola package installed. -The decision to use debian:stable was influenced by:: +The decision to use debian:stable was influenced by `this document `_ :: -> Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. + Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. This image works in docker even if your host system is not running Debian. From 124e28fbafd73431a194a9ba7cba95f4c980d814 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:14:56 -0500 Subject: [PATCH 32/39] minor edits to README --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 0903559..9073fbf 100644 --- a/README.rst +++ b/README.rst @@ -5,11 +5,11 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the debian:stable image, Python developer packages, and the latest Nikola package installed. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment built on the `debian:stable` base image in the Dockerfile, Python developer packages, and the latest Nikola[extras] Python package. The decision to use debian:stable was influenced by `this document `_ :: - Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. + Whenever possible, use current Official Repositories as the basis for your image. We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. This image works in docker even if your host system is not running Debian. From fc95dbaee341449a2e417db98d71ad532ed548a4 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:16:09 -0500 Subject: [PATCH 33/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9073fbf..4d05aaf 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment built on the `debian:stable` base image in the Dockerfile, Python developer packages, and the latest Nikola[extras] Python package. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment built on the ``debian:stable`` base image in the Dockerfile, Python developer packages, and the latest ``Nikola[extras]`` Python package. The decision to use debian:stable was influenced by `this document `_ :: From 58636b1eea74787cc77e29b75ddc05305fe3d159 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:17:40 -0500 Subject: [PATCH 34/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4d05aaf..a511bcb 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ Purpose This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment built on the ``debian:stable`` base image in the Dockerfile, Python developer packages, and the latest ``Nikola[extras]`` Python package. -The decision to use debian:stable was influenced by `this document `_ :: +The decision to use ``debian:stable`` was influenced by `this document `_ :: Whenever possible, use current Official Repositories as the basis for your image. We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. From eda1066d481e3b4e3f9eda85eaf41886a2205a3f Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:24:17 -0500 Subject: [PATCH 35/39] minor edits to README --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index bece667..87304aa 100644 --- a/README.rst +++ b/README.rst @@ -5,11 +5,11 @@ Nikola Appliance Purpose ########### -This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment based on the debian:stable image, Python developer packages, and the latest Nikola package installed. +This ``Dockerfile`` creates a sandboxed, runnable `Nikola `_ environment built with the ``debian:stable`` image, Python developer packages, and the ``Nikola[extras]`` package installed. -The decision to use debian:stable was influenced by:: +The decision to use ``debian:stable`` was influenced by `this document `_ :: - `Whenever possible, use current Official Repositories as the basis for your image.We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. `_ + Whenever possible, use current Official Repositories as the basis for your image. We recommend the Debian image since it’s very tightly controlled and kept extremely minimal (currently under 100 mb), while still being a full distribution. This image works in docker even if your host system is not running Debian. From 76a486a08e3c2c5859eae3e63d811f7b850f19b8 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:44:37 -0500 Subject: [PATCH 36/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 87304aa..f5eca56 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ versions of docker. To install docker on your system, see the official Installation ############## -To pull the docker image. (This is much faster than building your own. lxml takes at least drinking a cup of coffee's time to build on my machine.):: +To pull the docker image. (Depending on your connection speed this is likely much faster than building your own.) :: $ docker pull dmmmdfll/nikola From ab383d5ef68e58490a4e6b3baf83ff58901af763 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:44:37 -0500 Subject: [PATCH 37/39] minor edits to README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 87304aa..f5eca56 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ versions of docker. To install docker on your system, see the official Installation ############## -To pull the docker image. (This is much faster than building your own. lxml takes at least drinking a cup of coffee's time to build on my machine.):: +To pull the docker image. (Depending on your connection speed this is likely much faster than building your own.) :: $ docker pull dmmmdfll/nikola From ce1e63ef41a969928ce8da0ac57a5911c7bfc121 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Tue, 15 Dec 2015 09:55:29 -0500 Subject: [PATCH 38/39] Corrected the docker image name. modified: nikola --- nikola | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nikola b/nikola index 2182c53..206a0df 100755 --- a/nikola +++ b/nikola @@ -7,7 +7,7 @@ docker run --rm -it \ -v $(pwd):$(pwd) \ -w $(pwd) \ -p 8000:8000 \ -dmmmdfll/nikola/debian \ +dmmmdfll/nikola \ -U ubuntu \ -u 1000 \ -G ubuntu \ From f2e7e7cbf38002aa66fba407f10f9fa1160a88a2 Mon Sep 17 00:00:00 2001 From: dmmmd Date: Sat, 19 Dec 2015 21:08:44 -0500 Subject: [PATCH 39/39] added yuicompressor and java modified: Dockerfile --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bab32dd..382c8c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,9 +29,12 @@ libxml2-dev \ libxslt1-dev \ libjpeg62-turbo-dev \ libfreetype6 \ -libfreetype6-dev +libfreetype6-dev \ +default-jdk -RUN pip3 install virtualenv +RUN pip3 install \ + virtualenv \ + yuicompressor RUN \ ["/bin/bash", \ "-c", \