PHPackages                             mf/docker-ip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mf/docker-ip

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mf/docker-ip
============

Finds suitable IP from `ifconfig` and then distribute this IP into hosts and docker file and allows revert changes.

1.0.0(9y ago)16MITPHPPHP &gt;=7.1

Since Jun 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MortalFlesh/docker-ip-php)[ Packagist](https://packagist.org/packages/mf/docker-ip)[ RSS](/packages/mf-docker-ip/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (13)Versions (2)Used By (0)

Docker Ip
=========

[](#docker-ip)

[![Latest Stable Version](https://camo.githubusercontent.com/c1f4dceadd2934c9404eb84e7270f76ede8952109de4a67006778ce5b0a23398/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d662f646f636b65722d69702e737667)](https://packagist.org/packages/mf/docker-ip)[![Total Downloads](https://camo.githubusercontent.com/572b58ad4527a5425f6feab039b01eb4d8a1565eea61aa0a1472807bff39828e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d662f646f636b65722d69702e737667)](https://packagist.org/packages/mf/docker-ip)[![Build Status](https://camo.githubusercontent.com/d7d04543103d158661c02e74f9333c9af1b3c10ec58d25c56410c93cf6f44353/68747470733a2f2f7472617669732d63692e6f72672f4d6f7274616c466c6573682f646f636b65722d69702d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MortalFlesh/docker-ip-php)[![Coverage Status](https://camo.githubusercontent.com/695a77edf59ede2fa267918423f62b58958097c3c49480856ad74621737016bf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d6f7274616c466c6573682f646f636b65722d69702d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/MortalFlesh/docker-ip-php?branch=master)[![License](https://camo.githubusercontent.com/2cdb177d7c3e204544db5a8a3318f173019d5abb71d99c5cb5918e8e6e455893/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d662f646f636b65722d69702e737667)](https://packagist.org/packages/mf/docker-ip)

Finds suitable IP from `ifconfig` and then distribute this IP into hosts and docker file and allows revert changes.

How to use?
===========

[](#how-to-use)

Install as dependency
---------------------

[](#install-as-dependency)

```
composer require --dev mf/docker-ip
```

How to run it?
--------------

[](#how-to-run-it)

### Show list of available commands

[](#show-list-of-available-commands)

```
vendor/bin/docker-ip-console list
```

### Usage:

[](#usage)

```
vendor/bin/docker-ip-console [command] [arguments]
```

#### Available commands:

[](#available-commands)

```
  help                          Displays help for a command
  list                          Lists commands
 docker-ip
  docker-ip:distributeIpToHost  Finds suitable IP from `ifconfig` and then distribute this IP into hosts and docker file
  docker-ip:revert              Reverts changes from `distributeIpToHost` in hosts and docker file

```

### Distribute IP to Host

[](#distribute-ip-to-host)

Finds suitable IP from `ifconfig` and then distribute this IP into hosts and docker file.

#### Usage:

[](#usage-1)

```
vendor/bin/docker-ip-console docker-ip:distributeIpToHost [options]
```

#### Options:

[](#options)

```
   -d, --domain=DOMAIN              Your local domain
       --docker-file=DOCKER-FILE    Full path to your docker compose yml
       --hosts[=HOSTS]              Full path to your hosts file [default: "/etc/hosts"]
   -p, --placeholder[=PLACEHOLDER]  Placeholder used in DOCKER_FILE [default: "DOCKER_IP_PLACEHOLDER"]
   -h, --help                       Display this help message
   -q, --quiet                      Do not output any message
   -V, --version                    Display this application version
       --ansi                       Force ANSI output
       --no-ansi                    Disable ANSI output
   -n, --no-interaction             Do not ask any interactive question
   -v|vv|vvv, --verbose             Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

#### Example of `/etc/hosts`

[](#example-of-etchosts)

```
127.0.0.1 your_domain

```

#### Example of `DOCKER_FILE.yml`

[](#example-of-docker_fileyml)

```
extra_hosts:
  - "your_domain:DOCKER_IP_PLACEHOLDER"
```

### Revert changes

[](#revert-changes)

Reverts changes from `distributeIpToHost` in hosts and docker file

#### Usage:

[](#usage-2)

```
vendor/bin/docker-ip-console docker-ip:revert [options]
```

#### Options:

[](#options-1)

```
       --docker-file=DOCKER-FILE  Full path to your docker compose yml
       --hosts[=HOSTS]            Full path to your hosts file [default: "/etc/hosts"]
   -h, --help                     Display this help message
   -q, --quiet                    Do not output any message
   -V, --version                  Display this application version
       --ansi                     Force ANSI output
       --no-ansi                  Disable ANSI output
   -n, --no-interaction           Do not ask any interactive question
   -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

#### Example of `/etc/hosts`

[](#example-of-etchosts-1)

```
#REPLACED_BY_DOCKER_IP 127.0.0.1 your_domain
{DOCKER_IP} your_domain

```

#### Example of `DOCKER_FILE.yml`

[](#example-of-docker_fileyml-1)

```
extra_hosts:
#REPLACED_BY_DOCKER_IP       - "your_domain:DOCKER_IP_PLACEHOLDER"
  - "your_domain:{DOCKER_IP}"
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bdf0b9957c08a48e70a52fce74fc4f1add30b12d442450d5e2b48854fc98b21?d=identicon)[MortalFlesh](/maintainers/MortalFlesh)

---

Top Contributors

[![MortalFlesh](https://avatars.githubusercontent.com/u/6317184?v=4)](https://github.com/MortalFlesh "MortalFlesh (20 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mf-docker-ip/health.svg)

```
[![Health](https://phpackages.com/badges/mf-docker-ip/health.svg)](https://phpackages.com/packages/mf-docker-ip)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M514](/packages/shopware-core)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
