New: Install Takeout with Docker

Feature image: New: Install Takeout with Docker

Takeout is a convenient layer on top of Docker that lets you quickly spin up services without looking up the images and how to run them.

Need a Redis service locally? Run:

takeout enable redis

You'll get it running in no time.

Need a MySQL service locally? Run:

takeout enable mysql

And you're done.

You can easily spin up specific versions of those services, too. It also works on any operating system.

Until now, Takeout has been distributed as a globally installed Composer package. This way has served us well and will still be around (although not recommended anymore), but it has downsides:

  • Takeout users had to install PHP on their local machines;
  • We sometimes get issues related to different PHP versions conflicting with the built PHAR archive;
  • PHP version upgrades would have to be documented and announced since they'd likely be breaking changes following this model. Since there's no transpiling/compilation involved in generating the PHAR archive, if we start using new PHP features, we'd need to lock the PHP version for the package, which would make it painful for users and so on.

We also secretly wanted to make Takeout available to more users, but it was still limited to only those who either have PHP installed locally or were willing to install PHP to use Takeout.

Starting today, we have a Docker-based installation for Takeout, which should fix most of the problems above (if not all). To install Takeout, all you need is to add an alias to your ~/.bashrc file (or similar) like this:

alias takeout="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -it tighten/takeout:latest"

That's it!

From now on, Docker itself is the only requirement for Takeout. No need to have PHP installed locally anymore. And, even if you do have it installed, your local PHP version won't conflict with the PHP version we're shipping Takeout with, which will give you more freedom to have the latest and greatest PHP installed locally, but also give us more freedom and flexibility to evolve the codebase as we see fit without requiring major version bumps on our end.

How It Works

We're building and publishing Takeout's Docker image as part of our release process. This image has PHP installed on it, Takeout's PHAR archive, and a Docker client.

In the alias, you can see that we're mapping the Unix socket that your local Docker client uses to interact with your local Docker daemon as a volume (the -v /var/run/docker.sock:/var/run/docker.sock). This alias and the socket location may change based on your operating system, the documentation has more examples for Windows users.

This socket allows the Docker Client inside the Takeout container to spin up containers on the host machine's Docker Daemon. How cool is that?

What's next

The old way of installing Takeout will still be around, but we'll drop all compatibility promises with older PHP versions. We'll keep it running on the latest and greatest without making announcements (besides mentioning it in the Changelog) or major version bumps.

We hope you appreciate the simplicity of the new installation process as much as we do. It's not perfect, as the image size is bigger than we wanted, but that shouldn't be a huge problem. We're exploring other options to ship Takeout as a standalone binary inside a tiny image, but this will do for now.

Please reach out if you have any questions at @TightenCo. And stay tuned if you want to know more about Takeout!

Get our latest insights in your inbox:

By submitting this form, you acknowledge our Privacy Notice.

Hey, let’s talk.

By submitting this form, you acknowledge our Privacy Notice.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Thank you!

We appreciate your interest. We will get right back to you.