dugajean/dockr-cli

This package is abandoned and no longer maintained. No replacement package was suggested.

Easy docker-compose local development setup for your LAMP and LEMP projects.

1.2.1 2019-05-14 20:01 UTC

This package is auto-updated.

Last update: 2022-08-29 02:08:43 UTC


README

Build Status Latest Stable Version Total Downloads License

Easy docker-compose local development setup for your LAMP and LEMP projects.

Requirements

  • Docker & docker-compose
  • PHP 7.1+
  • ext-json
  • ext-ctype

Download

For direct use

To download the latest release, head over to Releases and pick the latest PHAR. Then:

$ dockr.phar --version

Feel free to move this to /usr/local/bin so you can run it from anywhere: $ mv ./dockr.phar /usr/local/bin/dockr

Per project installation
$ composer require dugajean/dockr-cli --dev
$ vendor/bin/dockr --version

Usage

Run the following command to initialize dockr:

$ dockr init

Open the newly created file dockr.json and read through it. Make sure everything is what you expect it to be. Then refer to the aliases section of the file. There you will see a couple of aliases preset for you: One will turn on the Docker containers and the other will shut them off.

Use as follows: $ dockr up and $ dockr down respectively.

You can also set your own aliases there to control your setup. You can set aliases for SSH-ing into a container, delete the docker images or whatever you want. You can also point to a class which extends Symfony's Command class by providing the fully qualified namespace.

Examples:

// ...

"aliases": {
    // ...
    "ssh": {
        "help": "SSH into a container.",
        "commands": [
            "docker-compose -f .docker/docker-compose.yml exec {container} bash"
        ]
    },
    "mycmd": [
        "\\Fully\\Qualified\\Namespace\\To\\MyCommand"
    ]
}

Execute the commands like so: $ dockr ssh php-fpm and $ dockr mycmd. As you can see, you can provide arguments to your custom commands.

For a full list of available commands, run $ dockr and if you need help with a specific command run:

$ dockr help <command>

Testing

$ vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

Pouch is released under the MIT License.