Kiwi Q - Need documentation on ".broken 2>&1"

Since there doesn’t appear to be a Kiwi forum but Kiwi is closely related to OBS, am asking this question here…

Issue:
Creating a docker image currentlly succeeds, but the image is ridiculously large considering the files in the image
I cannot find anything amiss in the build log (which is successful, but since I strongly feel the issue is created very near the end, I have posted the final 100 lines of the build log at http://susepaste.org/31489577
The phenomenom is repeatable and consistent.

Replicating the issue:
Install the correct version of Kiwi that supports docker

zypper ar http://ftp5.gwdg.de/pub/opensuse/repositories/Virtualization:/Appliances/openSUSE_13.1/  

Install kiwi and kiwi-docs(During my investigation I’ve installed many more kiwi packages, but these are the minimal essentials)

zypper in kiwi kiwi-docs

Follow the instructions in “/usr/share/doc/packages/kiwi/examples/suse-13.1/suse-docker-container.readme” as follows

kiwi -p /usr/share/doc/packages/kiwi/examples/suse-13.1/suse-docker-container \
         --root /tmp/mycontainer

Then inspect the size of the target directory (In the above example /tmp/mycontainer)
Note that above I am recommending the exact code from documentation, whereas my log records describe my target directory as “mydocker-build-a”
As you might guess, I have run various docker builds from the same build directory but pointing to different target directories to test output without destroying previous attempts.

Monitoring, attempting to determine cause
My current speculation is based on repeatedly monitoring the size of the target (destination) directory during the Prep and Image creation step(the above kiwi command). The directory size appears to be very reasonable in size through most of the process (<120MB) until shortly before completion when it jumps to almost 600MB.

Speculation
I suspect that the original target file system is too small, and is enlarged later by some default and perhaps arbitrary number. I seem to remember something like this using dd(would be completely unrelated, but who knows if a similar occurence) where if a file is too small, then it is automatically expanded by a set amount, and I am speculating that when 100MB is too small, then another 500MB is concatenated automatically.

**The exact suspect command **(in the logs)
The full command follows which I believe creates the initial target. I don’t know anything about this syntax which apparently is unique to kiwi(at least Google only lists instances where it shows up in kiwi)

EXEC [touch /tmp/mydocker-build-a/.broken 2>&1]

Looking for ways to resolve, troubleshoot or either disabuse me of my speculation :slight_smile:

TIA,
TSU

I do not know anything about the subject, but seeing that you ask for an explanation about what the above could mean, I will give that a try.

This seems to tell that in some circumstances the command

touch /tmp/mydocker-build-a/.broken 2>&1

must be executed. This command is a shell command (is valid for many shells, but let us assume bash). See

man touch

In short, it will either change the access and modification timestamps of the file to “now” if it exists, or will create the file (empty, with zero bytes) if it does not exist (and then it will of course also have the timestamps of this very moment).
It can do this of course only if the directory the file is (to be) in (/tmp/docker-build-a) exists and the action is allowed to the user (permission bits).

The addition 2>&1 means that output to standard error is redirected to standard out. Thus all messages ouput by touch wll be united in stdout regardless if they where originaly intended by the programmer for stdout or stderr). That can be usefull if the command is executed in some enveloping environment where all stdout is e.g. redirected to a log file.

Thx,
Necessary information although not providing a key to what I’m seeing… which is that the initial file system is immediately approx 100MB on creation, remains so as files are written to it and a split second before the Kiwi Build script completes, it jumps to 600MB and about a half dozen commands are completed (as seen in stdout) at once.

Was hoping that the “touch” syntax somehow specified the initial size but apparently not so.

Am toying with the idea of “test by modification” but so far am not able to locate where kiwi stores its profile scripts (when a “type” is declared, the build script for that type). If I can locate that code, I’ll probably try to create an initial target fs file sufficiently large to see if I can avoid what I think is the step enlarging the file later.

TSU