Case Imagine the following scenario: your world-famous web application is hosted with two Docker containers (eg. with application server). Both containers have access to same host’s directories (passed with Docker’s -v parameter) mounted as:
/configuration - containing few configuration files, /logs - storing log files outside containers. Arguably, there are lots of better solutions (including databases, log indexing systems etc.) but that’s the issue we need to face now.
The following user accounts are involved:
When bytes
meet Mike
Hi! 👋 I'm Mike, a.k.a @mikemybytes, building distributed systems for fun and living. While I specialize in JVM technologies (mainly Java, Kotlin, Spring), my professional interests go far beyond that. Let me show you what I found interesting!

Even if committing changes with git is straightforward, sometimes you want to verify all changes before doing it (e.g. to come up with with a nice and meaningfull commit message). Luckily there is --verbose switch for git commit. According to the manual (git commit --help):
-v, --verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has.
Tests are the light side of programming. Period. Running test cases is one of the fundamental duty of every build automation system - including Maven. Even if it’s a kind of ritual and the determinant of style, every experienced programmer knows that sometimes things just have to be MacGavyered instantly. But how to fold up a late night app version using only Maven, bottle of ketchup and an old shoelace if our tests just don’t pass?
When docker kicked in to the enterprise market many things started changing. Along with microservice-based architectures it became a must-have technology for any “modern” project (the containers idea itself isn’t new - docker has just made things much simplier). In analogy to Java related slogan from 1995 “Write once, run anywhere” almost 20 years later docker enthusiasts say: “Build once, run everywhere”. In fact both ideas can coexist easily and that’s probably one of the reason they really do in practice nowadays. However, there ain’t no such thing as a free lunch…
Nowadays we can argue if using Apache FOP is still the best solution for generating PDF documents. One of it’s biggest competitors is probably JasperReports Library which supports multiple file formats and does not require creating XML templates manually from scratch (thanks to Jaspersoft Studio).
However, sometimes you just have to face the FOP’s XML monster :)
The FOP’s way of styling elements (text blocks, tables etc.) is almost identical to the CSS. But what if you want table cell content centered vertically? Probably you will try with something like (CSS way):
For some compatibility reasons I needed to checkout specific branch or tag in the Git repository using only it’s name (last part without refs/.../ prefix) from a bash script.
For Mercurial repositories it’s not a problem at all thanks to:
hg checkout $tagOrBranch I haven’t found similar solution using git checkout, so as a workaround I’ve prepared the following bash script to do the job:
git fetch --all if git show-ref | grep "refs/remotes/origin/$tagOrBranch" then echo "It looks like a branch" git checkout -b $tagOrBranch git pull origin $tagOrBranch else if git show-ref --tags | grep "refs/tags/$tagOrBranch\$" then echo "It looks like a tag" git checkout tags/$branchOrTag else echo "No branch / tag '$branchOrTag' found" exit 1 fi fi
This post couldn’t have started different - since I’m calling myself a developer.
Why Yet Another Developer Blog? It’s always good to write down things before forgetting them - isn’t it a perfect excuse? Probably there is also another motivation…
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein