igor-kozhevnikov / cross-docker
Set of console commands for docker
v1.5.1
2023-08-27 18:22 UTC
Requires
- php: ^8.1
- igor-kozhevnikov/cross: ^1.0
- vlucas/phpdotenv: ^5.5
Requires (Dev)
- phpstan/phpstan: ^1.10
- squizlabs/php_codesniffer: ^3.7
README
Set of console commands for docker.
Install
This package depends on Cross package.
composer require igor-kozhevnikov/cross-docker
Configuration
If your project doesn't have a cross.php
config file in the root directory, just run the follow command.
./vendor/bin/cross cross:config
Add data as described below to the cross.php
file.
<?php return [ 'plugins' => [ \Cross\Docker\Plugin\Plugin::class => [ 'env_paths' => 'docker/.env', ], ], 'commands' => [ \Cross\Docker\Commands\SSH::class => [ 'container' => 'packager_workspace', ], ], ];
To learn more about the available configurations, see the plugin and commands config files.
Commands
Build containers
./vendor/bin/cross docker:build [options] [--] [<container>]
Arguments:
container
Container for building
Options:
--no-cache
Don't use cache during build
Config:
options
Applied options
Down containers
./vendor/bin/cross docker:down
Config:
options
Applied options
Restart containers
./vendor/bin/cross docker:restart [options]
Options:
-d
--down
Downing containers instead of stopping
Go into a container
./vendor/bin/cross docker:ssh
./vendor/bin/cross ssh
Config:
container
Container to enteroptions
Applied optionscommand
Command to executearguments
Applied arguments for the command
Start containers
./vendor/bin/cross docker:start
./vendor/bin/cross start
Stop containers
./vendor/bin/cross docker:stop
./vendor/bin/cross stop
Config:
options
Applied options
Up containers
./vendor/bin/cross docker:up [options] [--] [<container>]
Arguments:
container
Container to up
Options:
--build
Build and run containers--remove-orphans
Run containers with removing orphans--no-detach
Run containers in front
Config:
options
Applied options
License
The Cross for Docker is open-sourced software licensed under the MIT license.