↓ Skip to main content

Posts

2017

Docker 1.13 is out

Docker 1.13 finally made it out the door earlier this week and I found some time to play around with it this weekend. I shan’t enumerate all of the new features here as the introductory post from Docker does a good job of that (or you can see the release notes for the gory details). Instead I’ll talk a little bit about some of the features that are of particular interest to me.

2016

Using the Docker remote API to retrieve container CPU usage

·4 mins
For reasons that I won’t go in to here, I’ve been interested in the CPU accounting aspect of cgroups for a while and I recently found some time to have a poke at what information is available in the Docker remote API. I was interested in getting hold of the actual CPU time used by a container versus the elapsed time that the container has been running for (where the former would be smaller if the container is not CPU intensive and would potentially be much larger if it’s chewing through multiple cores).
Barcelona Break

Barcelona Break

·3 mins
In general, we’re not very good at combining business trips with pleasure but at half term I was due to be in a conference in Madrid for the latter part of the week and Christine was about to start a new collaboration based in Barcelona so we decided to take the children over to Spain for a few days. Things didn’t get off to a great start with a three-hour delay on our Easyjet flight to Barcelona. To be fair, they did let us know of the delay before we left home and thankfully we’d already made arrangements for late arrival at our apartment.
Running Weekend

Running Weekend

·2 mins
It’s been a weekend for running. On Saturday Christine ran at the first of this year’s Hampshire Cross-Country races at Farley Mount. I didn’t feel 100% when I woke up so decided to save myself for Sunday. Although I felt much better by the time the races came round it was probably still a wise decision (not least to reserve some energy for a barn dance in the evening!).

Ocknell Orienteering

·1 min
Saturday saw our second orienteering outing of the season, SOC’s event at Ocknell. We were running the children’s activity which, as it involved finding a randomly scattered selection of controls, didn’t involve too much in the preparation but seemed to be enjoyed by the kids nevertheless. My apologies go to the little girl who turned up at the end when we’d run out of prizes!
Duncan @ 7

Duncan @ 7

·2 mins
I’ve been telling people that my children are seven and nine for some months now but Duncan has now actually reached the first of these milestones. His party was this weekend and, having spent the past month or so engrossed in Asterix books, that was the theme of his party (despite most of his friends having no idea who Asterix is!). The class teddy was brought to the party and is featured here in his Obelix plaits. The other attendees seemed to prefer the lively party games that Christine had contrived, from hunt the Roman to newspaper snowball fights and stuffing the balloons in to Obelix’s XL thermal tights!

Docker swarm mode on IBM SoftLayer

Having written a few posts on using the IBM Containers service in Bluemix I thought I’d cover another option for running Docker on IBM Cloud: using Docker on VMs provisioned from IBM’s SoftLayer IaaS. This is particularly easy with Docker Machine as there is a SoftLayer driver. As the docs state, there are three required values which I prefer to set as the environment variables SOFTLAYER_USER, SOFTLAYER_API_KEY and SOFTLAYER_DOMAIN. The instructions to retrieve/generate an API key for your SoftLayer account are here. Don’t worry if you don’t have a domain name free - it is only used as a suffix on the machine names when they appear in the SoftLayer portal so any valid value will do. With those variables exported, spinning up three VMs with Docker is as simple as:

Building application images with WebSphere traditional

For a while now I’ve had a bullet point on a chart that blithely stated that you could add an application on top of our WebSphere Application Server traditional Docker image using wsadmin and, in particular, with the connection type set to NONE i.e. without the server running. Needless to say, when I actually tried to do this shortly before a customer demo it didn’t work! Thankfully, with moral support from a colleague and the excellent command assistance in the admin console, it turns out that my initial assertion was correct and the failure was just down to my rusty scripting skills. Here’s how…

Using Rocker to build Liberty images from Java source

Looking for solutions to my archive extraction problem brought me to look at the Rocker project from Grammarly. I’d looked at it before but not in any great detail. In a nutshell, it aims to extend the Dockerfile syntax to overcome some of its current limitations. Although not an option for me (because I can’t depend anything beyond the standard Docker toolset) the Rocker solution to my earlier problem would be as simple as follows:

Unpacking an archive as a non-root user during docker build

The way we build our WebSphere traditional Docker images is as a two-step process. First we install the products using Installation Manager and generate a tar file containing the installed product. Then we suck that tar file in to a clean image so that the resulting image does not contain all the cruft left lying around from the install process. (Not including Installation Manager in the final image also helps to reinforce that these images are intended to be immutable.)

Containerizing background processes

The lifetime of a Docker container is tied to the lifetime of the PID 1 process executed when the container was started. WebSphere Liberty has a convenient server run command to run the application server in the foreground. Sadly, that’s not the case with the traditional WebSphere’s startServer.sh script which simply starts the server process in the background and then exits. To ensure that the container didn’t exit as well, we started out with a script something along the following lines:
Start of the season

Start of the season

·2 mins
The orienteering season got under way for us yesterday with a SOC event on an area called Salisbury Trench (east of Janesmoor Pond). Christine was saving herself for the Hursley 10K on Sunday so just took the children round the yellow course. (Actually, the children plus the pictured bear which Duncan has on loan from school as ‘Star of the Week’. It’s slightly concerning that he’s been awarded this in only the second week of the school year as normally it seems to go to those in need of some encouragement at school! Anyway, I digress…)

Container Camp III

·3 mins
On Friday I attended my third Container Camp UK. The venue had changed once more, this time taking up residence in the Picturehouse Central cinema by Piccadilly Circus. As with last year, this meant comfy seats which, contrary to what you might think, actually makes it easier to stay awake! In another repeat from 2015, we started late and connecting to the projector proved problematic throughout the day. This time we had a selection of shiny MacBooks with their new-fangled USB-C connectors to thank!
Summer Holidays: Act Three

Summer Holidays: Act Three

·5 mins
This final instalment is mostly taken up with our actual summer holiday. Taking a holiday in Britain at the end of August can sometimes be testing the definition of summer and, as we set off for Pembrokeshire, we were heading in to gale force winds. To be fair, this kept the roads fairly empty and, when we arrived at Broad Haven, meant there were some impressive waves breaking against the sea wall. We were staying in a ’lodge’ at the same place we’d stayed six years earlier when Duncan would have been about 9 months old.
Summer Holidays: Act Two

Summer Holidays: Act Two

·3 mins
We returned to pick the children up from Monmouth the following weekend, stopping off at Dyrham Park on the way back. Quite apart from it being a convenient place just off the M4 to stop for lunch, the children had last been there when the roof was in the process of being replaced following a fire and were keen to see how it now looked. The scaffolding that they had previously ascended to look down on the roof was all gone and, at least externally, the property was once again looking in fine form.
Summer Holidays: Act One

Summer Holidays: Act One

·2 mins
The Summer school holidays began with an event of mixed emotions as I coaxed the ailing (flightless and quite possibly sightless) juvenile crow that had occupied our back garden for the past month or so in to a cardboard box. Whilst I was out at work, Christine and the children deposited it at the local vets. What its fate was there we don’t know. It does, however, mean that we are no longer woken early by its cries for food and that we can hang the washing out unmolested!