• Stars
    star
    1,590
  • Rank 29,413 (Top 0.6 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 4 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker-based development-only dependency manager. macOS, Linux, and WSL2-only and installs via PHP's Composer... for now.

Takeout - Docker-based dependency management

Takeout

Run tests Lint Latest Version on Packagist Downloads on Packagist

Takeout is a CLI tool for spinning up tiny Docker containers, one for each of your development environment dependencies.

It's meant to be paired with a tool like Laravel Valet. It's currently compatible with macOS, Linux, Windows 10 and WSL2.

With takeout enable mysql you're running MySQL, and never have to worry about managing or fixing Homebrew MySQL again.

But you can also easily enable ElasticSearch, PostgreSQL, MSSQL, Mongo, Redis, and more, with a simple command. For a current list of services, look at the classes available in this directory: https://github.com/tighten/takeout/tree/main/app/Services

Requirements

Installation

Install Takeout with Composer by running:

composer global require tightenco/takeout

Make sure the ~/.composer/vendor/bin directory is in your system's "PATH".

Usage

Run takeout and then a command name from anywhere in your terminal.

One of Takeout's primary benefits is that it boots ("enables") or deletes ("disables") Docker containers for your various dependencies quickly and easily.

Because Docker offers persistent volume storage, deleting a container (which we call "disabling" it) doesn't actually delete its data. That means you can enable and disable services with reckless abandon.

Enable a service

Show a list of all services you can enable.

takeout enable

Enable specific services

Passed the short name of one or more services, enable them.

takeout enable mysql

takeout enable redis meilisearch

Enable services with default parameters

If you want to skip over being asked for each parameter and just accept the defaults. This also works with multiple services in one command.

takeout enable mysql --default

takeout enable redis meilisearch --default

Passthrough Container Arguments

You may specify extra arguments to the container after a -- sepatator:

takeout enable mysql -- -hsome.mysql.host -usome-user

Notice that these are arguments for the container Entrypoint, not extra docker run options (see below).

Extra docker run Options

Under the hood, the takeout enable command generates a docker run command. Sometimes you may want to specify extra options to the docker run command such as an extra environment variable or an extra volume mapping. You can pass a string with all the extra docker run options using the --run= option:

takeout enable mysql --run="{docker-run-options}"

Which would generate the following command:

docker run {docker-run-options} {service-options} mysql/mysql-server

Where {docker-run-options} are the options you specify inside the --run option and {service-options} are generated based on the default options for that service.

Mixing docker run Options With Container Arguments

You may mix and match the run options with the container arguments:

takeout enable mysql --run="{docker-run-options}" -- -hsome.mysql.host -usome-user

Disable a service

Show a list of all enabled services you can disable.

takeout disable

Disable specific services

Passed the short name of one or more services, disable the enabled services that match them most closely.

takeout disable mysql

takeout disable redis meilisearch

Disable all services

takeout disable --all

Start a stopped container

Show a list of all stopped containers you can start.

takeout start

Start specific stopped containers

Passed the container ID of one or more stopped containers, start the stopped containers that matches them.

takeout start {container_id}

takeout start {container_id1} {container_id2}

Start all containers

You may pass the -all flag to start all enabled containers.

takeout start --all

Stop a running container

Show a list of all running containers you can stop.

takeout stop

Stop specific running containers

Passed the container ID of one or more running containers, stop the running containers that matches them.

takeout stop {container_id}

takeout stop {container_id1} {container_id2}

Running multiple versions of a dependency

Another of Takeout's benefits is that it allows you to have multiple versions of a dependency installed and running at the same time. That means, for example, that you can run both MySQL 5.7 and 8.0 at the same time, on different ports.

Run takeout enable mysql twice; the first time, you'll want to choose the default port (3306) and the first version (5.7), and the second time, you'll want to choose a second port (3307), the second version (8.0) and a different volume name (so that they don't share the same mysql_data).

Now, if you run takeout list, you'll see both services running at the same time.

+--------------+----------------+---------------+-----------------------------------+
| CONTAINER ID | NAMES          | STATUS        | PORTS                             |
+--------------+----------------+---------------+-----------------------------------+
| 4bf3379ab2f5 | TO--mysql--5.7 | Up 2 seconds  | 33060/tcp, 0.0.0.0:3306->3306/tcp |
| 983acf46ceef | TO--mysql--8.0 | Up 35 seconds | 33060/tcp, 0.0.0.0:3307->3306/tcp |
+--------------+----------------+---------------+-----------------------------------+

FAQs

Will this enable the PHP drivers for me via PECL?

Sadly, no.

If I disable a service but Takeout still shows the port as taken, how do I proceed?

First, run lsof -i :3306 (where 3306 is the port that's unavailable.)

If you see output like this:

com.docke   936 mattstauffer   52u  IPv6 0xc0d6f0b06d5c4efb      0t0  TCP localhost:mysql->localhost:62919 (FIN_WAIT_2)
TablePlus 96155 mattstauffer   16u  IPv4 0xc0d6f0b0b6dccf6b      0t0  TCP localhost:62919->localhost:mysql (CLOSE_WAIT)

The solution is to just close your database GUI, and then it should be released.

Why would you use this instead of `docker-compose`?

Using docker-compose sets up your dependencies on a project-by-project basis, which is a perfectly fine way to do things. If it makes more sense to you to have a single copy of each of your dependencies for your entire global environment, Takeout makes more sense.

Will disabling a service permanently delete my databases?

Nope! Your data will stick around! By default almost all of our services use a "volume" to attach your data to for exactly this reason.

So, when you disable the MySQL service, for example, that volume--with all your data in it--will just sit there quietly. And when you re-enable, as long as you attach it to the same volume, all your data will still be there.

Future plans

The best way to see our future plans is to check out the Projects Board, but here are a few plans for the future:

  • Electron-based GUI
  • self-remove command: Deletes all enabled services and then maybe self-uninstalls?
  • upgrade: destroys the old container, brings up a new one with a newly-specified tag (prompt user for it, default latest) and keeps all other parameters (e.g. port, volume) exactly the same as the old one
  • pt/passthrough: proxy commands through to docker (./takeout pt mysql stop)
  • Deliver package in a way that's friendly to non-PHP developers (Homebrew? NPM?)
  • Allow other people to extend Takeout by adding their own plugins (thanks to @angrybrad for the idea!)

Process for release

If you're working with us and are assigned to push a release, here's the easiest process:

  1. Visit the Takeout Releases page; figure out what your next tag will be (increase the third number if it's a patch or fix; increase the second number if it's adding features)
  2. On your local machine, pull down the latest version of main (git checkout main && git pull)
  3. Build for the version you're targeting (php ./takeout app:build)
  4. Run the build once to make sure it works (php ./builds/takeout list)
  5. Commit your build and push it up
  6. Draft a new release with both the tag version and release title of your tag (e.g. v1.5.1)
  7. Use the "Generate release notes" button to generate release notes from the merged PRs.
  8. Hit Publish release
  9. Profit 😆

More Repositories

1

ziggy

Use your Laravel routes in JavaScript.
JavaScript
3,816
star
2

jigsaw

Simple static sites with Laravel’s Blade.
PHP
2,115
star
3

collect

A Collections-only split from Laravel's Illuminate Support
PHP
1,506
star
4

parental

Use single table inheritance in your Laravel app
PHP
1,327
star
5

mailthief

A fake mailer for Laravel Applications for testing mail.
PHP
685
star
6

lambo

Quick new application creation with Laravel and Valet
PHP
612
star
7

tlint

Tighten linter for Laravel conventions.
PHP
517
star
8

duster

Automatic configuration for Laravel apps to apply Tighten's standard linting & code standards.
PHP
409
star
9

novapackages

PHP
334
star
10

quicksand

Easily schedule regular cleanup of old soft-deleted Eloquent data.
PHP
294
star
11

gistlog

GistLog - simple, easy blogging based on GitHub gists
CSS
274
star
12

symposium

Management of proposals, bios, photos, etc. for conference speakers.
PHP
177
star
13

nova-google-analytics

Google Analytics integration with Laravel Nova
PHP
161
star
14

onramp

Easing the onramp for new or non-PHP developers to become Laravel devs.
PHP
157
star
15

overload

Method overloading in PHP
PHP
115
star
16

nova-stripe

Easily show information about Stripe charges and balances in your Nova dashboard
JavaScript
103
star
17

giscus

Notifications for Gist Comments
PHP
103
star
18

laravelversions

PHP
94
star
19

jigsaw-blog-template

Starter template for a blog, using Jigsaw by Tighten
Blade
91
star
20

confomo

ConFOMO is a simple tool that makes it easy to track your friends at conferences.
JavaScript
74
star
21

ozzie

Open source project monitor for Tighten
PHP
56
star
22

nova-package-development

A forum for talking about the process of Nova Package Development
52
star
23

jigsaw-docs-template

Starter template for a documentation site, using Jigsaw by Tighten
Blade
44
star
24

craft-build-query

A plugin for Craft CMS, demonstrating how to build complex or optimized queries by modifying an ElementCriteriaModel.
PHP
39
star
25

liftoff

A quick start for Laravel development in a new environment
Shell
38
star
26

builtwithjigsaw

A list of sites built with Jigsaw
Blade
35
star
27

react-gif-search-engine

React GIF Search Engine
JavaScript
33
star
28

react-gif-search-engine-old

JavaScript
32
star
29

jigsaw-site

Jigsaw Documentation Site
Blade
30
star
30

blink-my-lights

Quick proof-of-concept for flashing/blinking lights with Laravel and IFTTT
PHP
26
star
31

laravelm1

Tracking what works and doesn't in the Laravel ecosystem on M1
Blade
25
star
32

configs

Standard config files for Tighten projects
PHP
24
star
33

built-with-laravel

Real organizations and companies building with Laravel.
PHP
24
star
34

nova-releases

A package to provide a card and a tool giving information about Nova releases, including whether you're current
Vue
20
star
35

consoles

Quick shortcut list to API developer consoles
PHP
19
star
36

json-api-examples

Implementing JSON:API in laravel
18
star
37

laravel-react-demo

Demo of how to include React components in a Laravel project with Elixir
PHP
17
star
38

laravel-mix-jigsaw

Laravel Mix plugin for Jigsaw.
JavaScript
16
star
39

nova-package-discovery

Nova card for showing stats from novapackages.com
PHP
16
star
40

simplecast-php

Simplecast PHP SDK
PHP
15
star
41

php-package-skeleton

Tighten's PHP Package skeleton -- inspired by & some source from spatie/skeleton-php
Shell
15
star
42

checkmate

Check the version of all your Laravel apps and notify if they're out of date
PHP
14
star
43

tighten-coding-standard

A PHP Code_Sniffer configuration for Tighten's coding standard.
PHP
14
star
44

saasaas

SaaSaaS - create your next "AirBnB for ___" idea
PHP
14
star
45

laravel-elixir-webpack-react

A package to provide support for compiling React JSX files in Laravel Elixir 6
JavaScript
13
star
46

podcast-subscriber

Easy podcast subscriber app
PHP
10
star
47

laravel-mix-react

Easy alternative Laravel Mix configuration for projects using React
JavaScript
10
star
48

laravel-preset-jest

Front-end presets that include Jest for React and Vue
PHP
9
star
49

laraveldrivers

List all third-party Laravel drivers
PHP
9
star
50

blade-style-guide

"PSR-Blade"--style guide for Laravel Blade
9
star
51

easy-embeddable-polls

easy-static-polls
Vue
8
star
52

valet-fallback

Fallback web site for Valet
PHP
8
star
53

phpreleases-action

GitHub action that integrates with the PHP Releases API.
7
star
54

dev-battle-1-react

Tighten Co. Senior Dev Battle - React app
PHP
7
star
55

dev-battle-1-vue

Tighten Co. Senior Dev Battle - Vue app[
JavaScript
6
star
56

duster-action

Dockerfile
6
star
57

react-native-time-input

A simple time input component with autoformatting.
TypeScript
6
star
58

jigsaw-collections-demo

CSS
5
star
59

tlint-plugin

TLint PHPStorm Plugin
Kotlin
4
star
60

gif-gif-vue

Samantha Geitz Jest testing in Vue Laracon talk
PHP
4
star
61

hyperspoon

Lua
4
star
62

gif-gif-react

React version of Samantha Geitz's Jest Testing Laracon talk
PHP
4
star
63

postit

PHP
3
star
64

laravel-elixir-elm

JavaScript
3
star
65

pickr-api

PHP
3
star
66

laravel-tricks

Laravel Tricks rewrite
PHP
3
star
67

tallstack

The new web site for tallstack.dev
PHP
2
star
68

jazz

JavaScript-inspired development utilities
PHP
2
star
69

nova-tighten-themes

Tighten's Nova Themes
CSS
2
star
70

learnwebdevelopment

LearnWebDevelopment.org
CSS
2
star
71

tlint-sublime-plugin

tlint-sublime-plugin
Python
2
star
72

intro-to-react

Intro to React workshop given by Samantha Geitz at PeersConf 2018
JavaScript
2
star
73

omgphp

OMGPHP.com
CSS
1
star
74

borsh-php

1
star
75

phpreleases

API endpoints with support information for PHP major/minor versions and releases 5.6 and later
PHP
1
star
76

pickr-nativescript

NativeScript version of Pickr for Tighten Dev Battle 2
CSS
1
star
77

automation-scripts

Lua
1
star
78

pickr-reactnative

JavaScript
1
star
79

mon-petit

PHP
1
star
80

whyphp

CSS
1
star
81

laravelstar

Vue
1
star
82

dev-battle-landing

Landing page for the Tighten Dev Battle
PHP
1
star