New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

soyhuce/laravel-docker

Interact with a Docker instance
15,317 2
Install
composer require soyhuce/laravel-docker
Latest Version:2.2.1
PHP:^8.3
Laravel:11 · 12
Older releases:7 – 10
License:MIT
Last Updated:Mar 17, 2026
Links: GitHub  ·  Packagist
Maintainer: SoyHuCe

Docker

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status GitHub PHPStan Action Status Total Downloads

This package allows you to communicate with a Docker instance via unix socket or API.

API mode is based on API Docker Engine

Installation

You can install the package via composer:

composer require soyhuce/laravel-docker

Utilisation

Configuration

Publish configuration file via:

php artisan vendor:publish --provider="Soyhuce\Docker\ServiceProvider"

API

To use this package with API drive, you can expose Docker on HTTP port.

For example, you can do this:

socat TCP-LISTEN:<port-number>,reuseaddr,fork UNIX-CLIENT:<path-to-unix-socket>

So, in your configuration file, you have to define your configuration file like this:

[
    'driver' => 'api',
    'version' => 'v1.40',
    'drivers' => [
        'api' => [
            'url' => 'http://127.0.0.1:<port-number>',
        ]
    ],
]

You can also use the unix socket to connect to Docker :

[
    'driver' => 'api',
    'version' => 'v1.40',
    'drivers' => [
        'socket' => [
            'unix_socket' => '/var/run/docker.sock',
        ],
    ],
]
Working with Docker containers
  • create($imageName, $containerName) : Create a container from an image
  • start($containerId) : Start a container from its name or id
  • stop($containerId) : Stop a container from its name or id
  • wait($containerId) : Wait a container from its name or id
  • delete($containerId) : Delete a container from its name or id
Working with Docker images
  • create($imageName, $tagName) : Pull an image
  • all() : Retrieve all images on your Docker instance
  • remove($imageName) : Remove an image from its name

Related Packages

railken/lara-eye
38,915 39
api
laravel/sail

Docker files for running a basic Laravel application.

238,837,646 1,922
juampi92/api-resources

Manage your resources maintaining API versioning

934,433 111
tailflow/laravel-orion

Orion for Laravel allows you to build a fully featured REST API based on your El...

803,682 1,592
unlu/laravel-api-query-builder

Laravel API Query Builder Package.

720,455 329

Version History

Version Released PHP Laravel License
2.2.1 ^8.3 ^11.0|^12.0 MIT
2.2.0 ^8.3 ^11.0|^12.0 MIT
2.1.0 ^8.3 ^11.0|^12.0 MIT
2.0.0 ^8.3 ^11.0 MIT
1.13.0 ^8.2 ^10.0 || ^11.0 MIT