<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Valentin's Lab &#187; admin</title>
	<atom:link href="https://vaab.blog.kal.fr/category/sci/comp/admin/feed/" rel="self" type="application/rss+xml" />
	<link>https://vaab.blog.kal.fr</link>
	<description>Ratiocination of an opensource techie</description>
	<lastBuildDate>Thu, 15 Nov 2018 08:04:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=vaab&amp;popout=1&amp;url=https%3A%2F%2Fvaab.blog.kal.fr%2F&amp;language=en_US&amp;category=text&amp;title=Valentin%27s+Lab&amp;description=Ratiocination+of+an+opensource+techie&amp;tags=blog" type="text/html" />
	<item>
		<title>docker update, or how to incrementally build images without Dockerfile.</title>
		<link>https://vaab.blog.kal.fr/2015/01/28/docker-update-or-how-to-incrementally-build-images-without-dockerfile/</link>
		<comments>https://vaab.blog.kal.fr/2015/01/28/docker-update-or-how-to-incrementally-build-images-without-dockerfile/#comments</comments>
		<pubDate>Wed, 28 Jan 2015 02:20:56 +0000</pubDate>
		<dc:creator><![CDATA[vaab]]></dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[incremental]]></category>

		<guid isPermaLink="false">http://vaab.blog.kal.fr/?p=546</guid>
		<description><![CDATA[This handy little script covers an important missing feature in current docker's tool set. I needed to build incrementally my images: From a given image, I want full script control (un-tamed shell scripts) and access to hosts files to do &#8230;<p class="read-more"><a href="https://vaab.blog.kal.fr/2015/01/28/docker-update-or-how-to-incrementally-build-images-without-dockerfile/">Read more &#187;</a></p>]]></description>
				<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>This handy little script covers an important missing feature in
current docker's tool set.</p>
<p>I needed to build incrementally my images:</p>
<p>From a given image, I want full script control (un-tamed shell
scripts) and access to hosts files to do whatever I want to
do. At the end, I need to commit the filesystem (and only the filesystem).</p>
<p><tt class="docutils literal"><span class="pre">docker-update</span></tt> manage all this:</p>
<pre class="literal-block">
docker-update my-docker-image -v /srv/files:/mnt/files &lt;&lt;EOF

## Full fledged shell script, will run in docker container
## have access to /mnt/files

cp /mnt/files/data /opt/myapp/data

...

EOF
</pre>
<p>A last thing about the <tt class="docutils literal"><span class="pre">docker-update</span></tt> script, is that it
tries to be clever (I know that's often the beginning of hell):
if you apply the same code to the same image ID, it won't execute
it, but will use the previous result instead.</p>
<p>You can disable the cache by inserting <tt class="docutils literal"># docker: ALWAYS</tt> in
your bash code.</p>
<p>You can look at the <a class="reference external" href="https://gist.github.com/vaab/89d710f452b1d4fc7912">source code of docker-update</a>, or directly
<a class="reference external" href="https://gist.githubusercontent.com/vaab/89d710f452b1d4fc7912/raw/7385874aba683250e873d56e4912b940f9c41be4/docker-update">download docker-update</a>.</p>
<div class="section" id="how-does-it-work">
<h3>How does it work</h3>
<p>It use <tt class="docutils literal">docker run <span class="pre">--entrypoint</span> /bin/bash IMAGE</tt> on the bash
script, then <tt class="docutils literal">docker commit</tt>.</p>
<p>Well that's the general
outline. In the detail, <tt class="docutils literal">docker</tt> <a class="reference external" href="https://github.com/docker/docker/issues/4362">current shortcomings</a> are making this idea much more
complex than it should.</p>
<p>The first <tt class="docutils literal">docker run</tt> will modify ENTRYPOINT and CMD of image,
so when you commit, you break your previous values. So
<tt class="docutils literal"><span class="pre">docker-update</span></tt> needs to save them, and push another commit to
set them back.</p>
</div>
<div class="section" id="docker-update-shortcomings">
<h3>docker-update shortcomings</h3>
<p>As a quick and dirty solution, this script has some shortcomings
and sharp corners.  Some of these could easily repaired, and
additions are welcome.</p>
<div class="section" id="nul-characters-in-your-code">
<h4>NUL characters in your code</h4>
<p>Any <tt class="docutils literal">NUL</tt> character from your bash script will be removed prior to be run.
That's a direct consequence of running <tt class="docutils literal">bash <span class="pre">-c</span> &quot;$code&quot;</tt>. There are probably
better ways to do this.</p>
</div>
<div class="section" id="complex-cmd-and-entrypoint">
<h4>Complex CMD and ENTRYPOINT</h4>
<p>I rely on the fact that the output format of <tt class="docutils literal">{{json .Config.Cmd}}</tt> templating system
is directly evaluable in the Dockerfile as arguments to CMD and ENTRYPOINT.</p>
<p>I'm pretty sure that this is bad. But it works in simple cases.</p>
</div>
<div class="section" id="caching">
<h4>Caching</h4>
<p>Remember that by default, your code will be checked wether it was already
run on the same image (identified by it's ID). If you don't want that to
happen, include <tt class="docutils literal"># docker: ALWAYS</tt>.</p>
<p>For instance:</p>
<pre class="literal-block">
docker-update MYIMAGE &lt;&lt;EOF
# docker: always
apt-get update &amp;&amp; apt-get upgrade -y
EOF
</pre>
</div>
<div class="section" id="docker-update-options">
<h4>docker-update options</h4>
<p>They are sent directly to <tt class="docutils literal">docker run</tt> command, and you can easily break
the command. It's primarily meant to be used with the <tt class="docutils literal"><span class="pre">-v</span></tt> option.</p>
</div>
</div>
</div>
 <p><a href="https://vaab.blog.kal.fr/?flattrss_redirect&amp;id=546&amp;md5=c2d6b5482df2e9d72fed4fb6d079f837" title="Flattr" target="_blank"><img src="https://vaab.blog.kal.fr/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>https://vaab.blog.kal.fr/2015/01/28/docker-update-or-how-to-incrementally-build-images-without-dockerfile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=vaab&amp;popout=1&amp;url=https%3A%2F%2Fvaab.blog.kal.fr%2F2015%2F01%2F28%2Fdocker-update-or-how-to-incrementally-build-images-without-dockerfile%2F&amp;language=en_GB&amp;category=text&amp;title=docker+update%2C+or+how+to+incrementally+build+images+without+Dockerfile.&amp;description=This+handy+little+script+covers+an+important+missing+feature+in+current+docker%27s+tool+set.+I+needed+to+build+incrementally+my+images%3A+From+a+given+image%2C+I+want+full+script+control...&amp;tags=docker%2Cimage%2Cincremental%2Cblog" type="text/html" />
	</item>
		<item>
		<title>SpamAssassin, Amavis and ubuntu</title>
		<link>https://vaab.blog.kal.fr/2012/04/02/spamassassin-amavis-and-ubuntu/</link>
		<comments>https://vaab.blog.kal.fr/2012/04/02/spamassassin-amavis-and-ubuntu/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 19:59:01 +0000</pubDate>
		<dc:creator><![CDATA[vaab]]></dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://vaab.blog.kal.fr/?p=291</guid>
		<description><![CDATA[If running spamassassin (SA) with amavis without usage of spamd on ubuntu 10.04 and you feel that sa-learn isn't working right, here are a few tips. I had mails that were false positive and I had to dig a little &#8230;<p class="read-more"><a href="https://vaab.blog.kal.fr/2012/04/02/spamassassin-amavis-and-ubuntu/">Read more &#187;</a></p>]]></description>
				<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>If running <tt class="docutils literal">spamassassin</tt> (SA) with <tt class="docutils literal">amavis</tt> <em>without</em> usage of <tt class="docutils literal">spamd</tt> on ubuntu 10.04 and you feel that <tt class="docutils literal"><span class="pre">sa-learn</span></tt> isn't working right, here are a few tips.</p>
<p>I had mails that were false positive and I had to dig a little more than usual to get it working.</p>
<dl class="docutils">
<dt>learning</dt>
<dd><p class="first">Think that SA is executed by <tt class="docutils literal">amavis</tt> user, so:</p>
<pre class="literal-block">
sudo -u amavis -H sa-learn --showdots {--ham|--spam} YOUR_MAIL_OR_MBOX_OR_MAILDIR
</pre>
<p class="last">The trick is the <em>sudo</em> part, <tt class="docutils literal"><span class="pre">sa-learn</span></tt> docs can be found everywhere on the net.</p>
</dd>
<dt>checking</dt>
<dd><p class="first">This is how to check how spamassassin will rate your mail:</p>
<pre class="literal-block">
cat badmail | sudo -u amavis -H spamassassin -t
</pre>
<p class="last">Which is very usefull when used with the same mail, before and after learning.</p>
</dd>
<dt>statistics</dt>
<dd><p class="first">Looking at statistics can be usefull to check that the number of spam and ham are consistent with your learning sessions:</p>
<pre class="last literal-block">
sudo -u amavis -H sa-learn --dump magic | grep am
</pre>
</dd>
</dl>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Do not forget to restart <tt class="docutils literal">amavis</tt> with <tt class="docutils literal">/etc/init.d/amavis restart</tt>.</p>
</div>
</div>
 <p><a href="https://vaab.blog.kal.fr/?flattrss_redirect&amp;id=291&amp;md5=d24d5215efba1f8072bece0a58c57fac" title="Flattr" target="_blank"><img src="https://vaab.blog.kal.fr/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>https://vaab.blog.kal.fr/2012/04/02/spamassassin-amavis-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=vaab&amp;popout=1&amp;url=https%3A%2F%2Fvaab.blog.kal.fr%2F2012%2F04%2F02%2Fspamassassin-amavis-and-ubuntu%2F&amp;language=en_GB&amp;category=text&amp;title=SpamAssassin%2C+Amavis+and+ubuntu&amp;description=If+running+spamassassin+%28SA%29+with+amavis+without+usage+of+spamd+on+ubuntu+10.04+and+you+feel+that+sa-learn+isn%27t+working+right%2C+here+are+a+few+tips.+I+had+mails+that...&amp;tags=blog" type="text/html" />
	</item>
	</channel>
</rss>
