Docker for Windows – mounting shared folders

Docker has a new offering: “Docker for Windows”.
It was made available during DockerCon 2016 (June) and uses Hyper-Visor instead of VirtualBox.

The resulting user experience is very much like running Docker on Linux.

However playing around with it yesterday I ran into a slight problem:

On a Windows machine, especially a developer-machine, there’s usually some sort of anti-virus software up and running. in my case that’s Norton. And part of the package is a firewall.

This firewall causes problems.

When “Docker for Windows” shares folders it uses SMB. SMB is (at least in the case of Norton Firewall) specifically mentioned as BLOCKED in the firewall rule …. somewhere waay down the list.

So in order for your containers to actually connect – you need to open the firewall .. just a bit.

Looking in the settings (right-click the little whale swimming in your taskbar …). You can see the address and subnet mask.

Docker for Windows Network

The two ports you need to open are
* 139 (netbios-ssn)
* 445 (microsoft-ds)

What you could do is allow that traffic from any IP. But since we already know the range docker will use why not use it?

Resulting rule would be something like “Allow inbound communication on ports.

Here’s all the tabs in Norton Rule editor (which you reach by opening Norton Security Center, click Settings -> Firewall -> Traffic Rules, then “Add”).

DfW-Norton

Note the Rule will be added at the bottom, so you’ll need to select it then click “Move up” until it’s at the top.
Also make sure that there’s a nice blue “X” in the active column.

As always I hope this help someone … and feel free to rant in the comments below.

Remember to restart Docker afterwards.

Testing can be done by running

docker run --rm -v c:/:/data alpine ls /data

Posted in Miscellaneous, Software development | Leave a comment

The virtual Java User Group (vJUG): Keeping up to date on the Java side

We all know Java is not “just” a language. Like all other major languages there is an eco-system consisting of utilities, frameworks and best practices surrounding the core language.

This eco-system is in a state of constant and rapid change (sometimes it even feels like chaos – given the speed of change) and this is a Good Thing. When a language and eco-system stops evolving – it tends to die.

For me the problem has always been: “How do I keep up”. One thing is putting in the effort to learn new “stuff”. Quite another is deciding and finding the new developments in the field.

Here The virtual Java User Group (vJUG) is a great source. A part from being run by some Good People, they also invite some Good People to give interesting Presentations. In vJUG that means a streamed event – with IRC interaction.

An when I say interesting .. I mean it. Here’s a short list of events just the past two months:

  • Value In Releationshows – How Graphs Make Databases Fun Again
  • So Why Would I Use a Distributed Database Like Cassandra?
  • State of the Art Data Access With Spring Data
  • DEVOXX UK Coverage (several streams)
  • Gradle: Hot Or Not
  • Java Byte Code In Practice

… and many more. Most presentations are about one hour of length and you can participate “From the comfort of Your Own Home”… so… what’s not to like here…

Membership is completely free. Sign-up on http://virtualjug.com/#join.

See you online.

Posted in Uncategorized | Leave a comment

Makers schedule, Managers schedule (on meetings)

Sten Vesterli has an excellent post today regarding meetings (stop having them or keep them short).

I like to write software – not talk about it – so I couldn’t agree more. But there is a level of meetings that we truly need.

Such as:

  • Meetings with Business regarding the changes they require
  • Coordination between development teams
  • Short (*very short*) status meetings to keep a Project Manager in the loop

Things like that. Some of this can, and should be, delegated to as few people as possible. Which is why Sten’s post should be taken to heart.

Paul Graham had a fantastic post in 2009 (linked here) regarding the different views on meetings between “Makers” and “Managers”. Managers in this context are people who spend their time managing work done by “Makers”. In IT-perspective this could be Project Managers, Team and Department Managers, a.s.o. The Makers are … well developers, analysts, testers, a.s.o.

Having been on both sides of this particular fence this post strikes a nerve. The basic premise is this:

  • Managers spend most of their time with meetings and correspondence
  • Makers spend most of their time creating stuff or thinking about how to create stuff

This means that for a Manager one more meeting – provided there is still time to have a Lunch – is not a problem. That’s what the day is filled with anyway.

For a Maker however a meeting during the day can blast that day to bits. Makers need to get in and stay in “The Zone”. “The Zone” is where you’re most productive – everything is clear all paths laid bare – now all we need to do is write the Code. Some studies (I can’t find them right now, sorry) have shown that getting back into “The Zone” can take as much as 1 hour, sometimes more.

So when a meeting is placed in the middle of a day, and that day happens to be a day where you need to tackle a difficult algorithm (or whatever) – then the day can be lost completely. There’s not enough time before the meeting, nor after to get in the zone and solve the thing.

So I couldn’t agree more. We need as few meetings as possible. And the one we do schedule should be as short as possible and placed during the early hours of the day – leaving the Makers enough time to get and remain productive.

Posted in Uncategorized | Leave a comment

Git – Careful with capital letters on Windows

I ran into an interesting little problem the other day.

A colleague asked why he couldn’t push his changes to Stash (Atlassians Enterprise git repository).

He has his Master branch updated from a feature-branch but couldn’t get Stash to accept his push.

The reason was that he had a branch called Master (notice the capital M”). This seemed to confuse “git for Windows” or Stash to no end.

The cure was to

  • delete the Master-branch and pull it from Stash.
  • Do the merge again
  • Then push

My guess to the reason for the problem is the difference between Windows and Unix/Linux regarding letter case. On Windows case is ignored in filenames, whereas they matter a great deal on Unix/Linux systems. If you create a file “Master” and a file “master” on Unix/Linux you’ll get two files. On Windows only one will survive …

Try this in Windows Explorer and you get the following
Master master

And since git uses the filesystem (where else would it put the information) it will overwrite the original “master” information. (Git has Linux origins. And like all things *nix the user is expected to know what his/she is doing … aka. Unix user-friendliness: “If you know what you’re doing: go ahead, I won’t stop you. But if you don’t know perhaps you should GET YOUR HANDS OFF THE KEYBOARD”). I like that attitude, but not everyone does.

Posted in Git | Leave a comment

Adjusting commits on master branch

A colleague has a problem the other day…

A developer has committed two commits to master that should have been on the start of a development-branch.

The problem
This is how the problem looks in a testbed:
8592-Capture-01

Two branches:

  • master with commits “B” and “C”.
  • And the branch “develop” with commits “D” and “E”.

What was wanted was

  • master with only commit “A”
  • develop with “B” through “E”

How to do it
The first thing to remember is that branches are nothing more than pointers into the commit-tree. So all we have to do is move some pointers…

First move the commits to the develop-branch. That means rebasing the develop-branch on top of master (since that’s where the two commits are).

git checkout develop
get rebase master
git pull
git push

8592-Capture-02

Then reset master

git checkout -B master master^^
git push –force

8592-Capture-03

Note that the commits “D” and “E” are still there, above the master-branch “pointer”. We can’t get rid of them, but they’ll not influence anything.

git checkout master
git merge develop
git push

8592-Capture-05

The full testbed can be downloaded here:
8592-setup

Posted in Git | Leave a comment

Useful documentation + automated testing

Sten Vesterli has an interesting post regarding Useless Documentation.

In short the most useful documentation is:
code comments & architecture diagrams. The rest is marginally useful … at best.

I couldn’t agree more.

Combine that with strong unit and integration tests and you’ll find your deliveries contain fewer errors and overall implementation speed will increase. Why? Because implementing just got easier. The information you need is available in the code and the tests help you discover errors early.

Posted in Software development | Leave a comment

Enterprise architecture and Organic Growth

I’d like to talk a bit about Organic Growth in IT.

Lets say we have a Client that is using a nightly-batch flow to handle the data-processing. Running everything on a single server was fine earlier but the number of transactions is rising, due to new business and take-overs. And now they’ve run out of “night-hours” – the batch-flow into the early working hours of the next day. The disks are also running full since the processing is replicating data between IT systems.

What do we do and why did this happen?
Continue reading

Posted in Software development | Leave a comment