Download the PHP package diego-ninja/docker without Composer

On this page you can find all versions of the php package diego-ninja/docker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package docker

🐋 Docker for PHP

Latest Version on Packagist Total Downloads PHP Version License: MIT GitHub last commit wakatime

[Tests]() [Static Analysis]() [Code Style]() [Coveralls]()

This package provides a fluent, modern API to start and manage Docker containers directly from your PHP code. It is a fork of spatie/docker with significant improvements in ergonomics, security, and functionality.

Key Features

Installation

You can install the package via Composer. It requires PHP 8.4 or higher.

Quick Start

The easiest way to use the package is through the Docker facade.

Key Differences with spatie/docker

This package is a fork of spatie/docker, but it introduces significant improvements:

  1. Facade for a Simplified API: The Docker facade provides a static, expressive, and easy-to-remember API, ideal for frameworks like Laravel or for quick usage.

  2. Type Safety with Value Objects: Instead of using raw strings and numbers, the library uses Value Objects to validate every parameter, preventing common errors and attacks.

  3. Specific Exceptions: More descriptive exceptions, like CouldNotStartDockerContainer, have been added to make debugging easier.

Detailed Usage

1. Using the Facade (Recommended)

The Docker facade offers three ways to create containers:

a) Shortcuts for Common Services

It includes shortcuts for the most popular services with pre-defined configurations.

You can pass a configuration array to customize the service:

b) Generic container() Builder

For any image that doesn't have a shortcut, use the container() method.

c) Registering Custom Services

You can register your own shortcuts, for example, in your application's bootstrap file.

2. Fluent API

All facade methods return a DockerContainer instance, so you can continue to use the fluent API to override or add configurations.

3. Configuration Examples

Port Mapping

Use port(hostPort, containerPort).

Volume Mapping

Environment Variables

4. Interacting with Running Containers

The start() method returns a DockerContainerInstance.

You can also connect to an already running container.

Testing

Before running the tests for the first time, you need to build the Docker image for testing:

Then, you can run the full test suite with Pest:

Changelog

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

Contributing

Please see CONTRIBUTING.md for details. Contributions are welcome.

Security

If you've found a security vulnerability, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see the License File for more information.


All versions of docker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
spatie/macroable Version ^2.0
symfony/process Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package diego-ninja/docker contains the following files

Loading the files please wait ...