running weewx under Docker

625 views
Skip to first unread message

vds

unread,
Jan 21, 2015, 3:28:24 PM1/21/15
to weewx...@googlegroups.com
I've been doing a little fiddling with Docker and cooked up the config files to bring up weewx in simulator mode, with nginx as the web layer and ssh enabled for poking around.  I thought I'd post a link to the files and instructions for trying it out.

Stuff is available on https://github.com/vinceskahan/weebian-docker if you have interest.  I have some other weewx and raspi related stuff up there as well if you wanted to poke around my repos on github.  Go appropriately wild :-)

Thomas Keffer

unread,
Jan 21, 2015, 5:31:53 PM1/21/15
to weewx-user
Thanks, Vince. It's nice to have this. I'm definitely becoming a Docker fan.

One bit of caution: your Dockerfile will generate a lot of images and could become quite big. Here's a nice explanation of the effect and what to do about it.

-tk

On Wed, Jan 21, 2015 at 12:28 PM, vds <vince...@gmail.com> wrote:
I've been doing a little fiddling with Docker and cooked up the config files to bring up weewx in simulator mode, with nginx as the web layer and ssh enabled for poking around.  I thought I'd post a link to the files and instructions for trying it out.

Stuff is available on https://github.com/vinceskahan/weebian-docker if you have interest.  I have some other weewx and raspi related stuff up there as well if you wanted to poke around my repos on github.  Go appropriately wild :-)

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vds

unread,
Jan 21, 2015, 7:12:48 PM1/21/15
to weewx...@googlegroups.com
On Wednesday, January 21, 2015 at 2:31:53 PM UTC-8, Tom Keffer wrote:
Thanks, Vince. It's nice to have this. I'm definitely becoming a Docker fan.

One bit of caution: your Dockerfile will generate a lot of images and could become quite big. Here's a nice explanation of the effect and what to do about it.


Absolutely, Docker's incremental buildup generates a lot of incremental layers for sure.  Usual care+feeding applies.

This particular case didn't cause too much waste it seems.  I flattened the image per the instructions in the link you provided and it only saved 1% of the size, so I guess that's good.  Most of the size of the growth was all the apt-get installations to get the additions to the very small baseline debian installed.

debian:latest is the base debian starting point.  weebian:latest is where I got to at the end.  weebian:flattened is the flattened version of the same end state, which I suppose would be a good starting point for other images/containers adding extensions or the like.  Docker is pretty cool for sure.

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
weebian             flattened           0b3a1b145cfc        3 minutes ago       320.8 MB
weebian             latest              62ae86bf4f67        19 hours ago        323.6 MB
debian              latest              4d6ce913b130        5 days ago          84.98 MB

Here's a cool command to show what layer added how much size...

$ docker history weebian
IMAGE               CREATED             CREATED BY                                      SIZE
62ae86bf4f67        19 hours ago        /bin/sh -c #(nop) CMD [/usr/bin/supervisord]    0 B
6a306f809ec0        19 hours ago        /bin/sh -c #(nop) COPY file:48a3344b2449be6d3   270 B
0989d2e35ee6        19 hours ago        /bin/sh -c mkdir /var/run/sshd                  0 B
8bf2e2cb815f        19 hours ago        /bin/sh -c echo "root:root" | chpasswd          627 B
e4c8f47ac182        19 hours ago        /bin/sh -c ln -s /usr/share/nginx/www /home/w   20 B
9a6a01a4b259        19 hours ago        /bin/sh -c cd weewx-* ; ./setup.py build ; ./   5.045 MB
8a8827ba7d2f        19 hours ago        /bin/sh -c tar zxvf /tmp/weewx.tgz              2.824 MB
b1090ae2e466        19 hours ago        /bin/sh -c cd /tmp                              0 B
07281cc57ffa        19 hours ago        /bin/sh -c wget http://sourceforge.net/projec   916.1 kB
41bdf5ecf73e        19 hours ago        /bin/sh -c apt-get install -y supervisor open   22.03 MB
7c1c401612a4        19 hours ago        /bin/sh -c apt-get update; apt-get install -y   207.8 MB
73f2da403e08        19 hours ago        /bin/sh -c #(nop) MAINTAINER Vince Skahan "vi   0 B
4d6ce913b130        5 days ago          /bin/sh -c #(nop) CMD [/bin/bash]               0 B
d0a18d3b84de        5 days ago          /bin/sh -c #(nop) ADD file:4a58c36173b61e8a7b   84.98 MB
511136ea3c5a        19 months ago                                                       0 B
 

Thomas Keffer

unread,
Jan 21, 2015, 7:16:29 PM1/21/15
to weewx-user
You're right: that's pretty minimal growth, and about as minimal a Python image as one can get away with to run weewx.

-tk

Ron Knapp

unread,
Nov 14, 2015, 9:52:00 AM11/14/15
to weewx-user
I am playing around with weewx in a docker container, I noticed some things have broken since the original Dockerfile and thought i'd mention them

./setup.py install --no-prompt

--no-prompt instead of --quiet in the install

Also the source appears to no longer be available on sourceforge, not sure if there is a method to get the latest I just downloaded a specific version.


Ron

vince

unread,
Nov 14, 2015, 9:20:04 PM11/14/15
to weewx-user
On Saturday, November 14, 2015 at 6:52:00 AM UTC-8, Ron Knapp wrote:
I am playing around with weewx in a docker container, I noticed some things have broken since the original Dockerfile and thought i'd mention them

./setup.py install --no-prompt

--no-prompt instead of --quiet in the install

Also the source appears to no longer be available on sourceforge, not sure if there is a method to get the latest I just downloaded a specific version.



Send me a pull request and I'll look at it....

 
Reply all
Reply to author
Forward
0 new messages