<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2025:07:23</title>
        <description></description>
        <link>https://baszerr.eu/</link>
        <lastBuildDate>Tue, 28 Apr 2026 12:15:32 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://baszerr.eu/</link>
        </image>
        <item>
            <title>2025-07-23_-_docker_and_eol_fuss</title>
            <link>https://baszerr.eu/doku.php?id=blog:2025:07:23:2025-07-23_-_docker_and_eol_fuss</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;docker_and_eol_fuss&quot;&gt;2025-07-23 - docker and EOL fuss&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
today i was struggling to understand what was going on with my ~simple application, that was printing some JSONs on the screen. seemingly all good when testing, when i ran it in an actual environment, it turned out that there&amp;#039;s something off with new lines formatting. after quite some digging i realized the problem was due to me calling it via &lt;code&gt;docker&lt;/code&gt;. to simplify it a bit, let&amp;#039;s say all it did was &lt;code&gt;echo x&lt;/code&gt; on the screen, i.e.:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;$ echo x | hexdump  -C
00000000  78 0a                                             |x.|
00000002 &lt;/pre&gt;

&lt;p&gt;
but then:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;$ docker run -it --rm debian:12 echo x | hexdump  -C
00000000  78 0d 0a                                          |x..|
00000003&lt;/pre&gt;

&lt;p&gt;
who ordered the &lt;code&gt;\r\n&lt;/code&gt; instead of &lt;code&gt;\n&lt;/code&gt;?!
&lt;/p&gt;

&lt;p&gt;
to make it harder to spot, it all worked fine when printing on the screen – it was only causing issues when pipe-ing, e.g. &lt;code&gt;docker … echo x | grep …&lt;/code&gt;, as EOLs were not interpreted correctly there…
&lt;/p&gt;

&lt;p&gt;
after more digging it turned out, that the problem was &lt;code&gt;-t&lt;/code&gt; flag (i.e. enable terminal). after removing it:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;$ docker run -i --rm debian:12 echo x | hexdump  -C
00000000  78 0a                                             |x.|
00000002 &lt;/pre&gt;

&lt;p&gt;
my problem went away.
&lt;/p&gt;

&lt;p&gt;
up until now i always added &lt;code&gt;-t&lt;/code&gt; every time i needed interactive input (&lt;code&gt;-i&lt;/code&gt;). today i learned that it&amp;#039;s more nuanced…
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 23 Jul 2025 18:49:32 +0000</pubDate>
        </item>
    </channel>
</rss>
