Easily Start and Stop Docker Compose Projects with Captain

Jens Segers has created a handy shell script to easily start/stop Docker Compose based projects:

Captain searches for docker-compose projects in your $HOME folder and allows you to start and stop those projects by passing a part of the parent directory name.

Let this small recording of Captain in action convince you:

Captain →

Related: Recently bumped into this basic instructional video to get WordPress up and running using a Docker setup containing a Caddy, Apache2/PHP7 and a MySQL container. Good one if you’re looking to get started with Docker.

Fix for the Android Emulator (Android Simulator) crashing during launch

UPDATE 2017.08.03: This should be fixed with the release of HAXM 6.1.1. Make sure you’re running the latest version of Android Studio

On a recent project I was working on, I wasn’t able to start the Android Emulator/Simulator anymore from within Android Studio. Every time I launched it from Android Studio it would start, but then – without any errors or warnings – close all by itself.

When I switched to launching the Android Emulator from the Command Line instead, I finally got to see an error message:

$ cd $(dirname $(which emulator)) && ./emulator -avd Nexus_5X_API_25
emulator: WARNING: encryption is off
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync HAX vcpu contextInternal error: Initial hax sync failed

Aha, a clue! One Google Search Coupon later it turns out the thing preventing the emulator from running was that other thing using vcpu’s, namely docker.

👉 Killing docker will let you run the Android Emulator without any problems.

I haven’t tested other suggested solutions (such as tweaking the settings of the virtual device), but at least this one did it for me.

Did this help you out? Like what you see?
Consider donating.

I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!

☕️ Buy me a Coffee ($3)

LocalStack – A fully functional local AWS cloud stack

At work we’ve been using several separate docker images – such as instructure/fake-s3 and airdock/fake-sqs, orchestrated by docker-compose – to run a few of the Amazon Web Services locally.

LocalStack provides the whole lot in one:

LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications. Currently, the focus is primarily on supporting the AWS cloud stack. LocalStack spins up the following core Cloud APIs on your local machine:

  • API Gateway
  • Kinesis
  • DynamoDB
  • DynamoDB Streams
  • Elasticsearch
  • S3
  • Firehose
  • Lambda
  • SNS
  • SQS
  • Redshift

LocalStack – A fully functional local AWS cloud stack →

If you’re looking to emulate Lambda, this article is also worth checking out.

Prevent time drift in Docker with docker-time-sync-agent

Today, at work, a colleague of mine ran into some time issues with his Docker containers: the time was clearly off. Turns out it’s a common problem:

Docker’s daemon fails to update the VM’s time after computer wakes up from sleep. The result is that VM’s clock will be set to a past time. This inturn will make Docker containers use that time.

Enter docker-time-sync-agent:

docker-time-sync-agent is a tool to prevent time drift in Docker for Mac’s HyperKit VM. It listens to system wakeup event and runs a shell script (update-docker-time) that updates the VM’s time. Time sync can be triggered manually anytime by running update-docker-time.

Install it using this oneliner (if you dare copy-pasting it, that is):

$ curl https://raw.githubusercontent.com/arunvelsriram/docker-time-sync-agent/master/install.sh | bash

docker-time-sync-agent – prevent time drift in Docker for Mac’s HyperKit VM →