You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would prefer to have a suggest for the bundle with the integration directly in this lib, so not required to use docker-php but suggested when using in cujunction with symfony
@joelwurtz I don't really see how this commit will make things simpler, could you please elaborate?
At the end, I still have to call DockerClient::createFromEnv manually or on the services, but how can I manage it from the bundle configuration? Assuming this:
Another weird thing: The Docker\Docker::create method takes the version as first argument. But the previous service configuration works... plus, I tried to pass a specific version to test:
19:18:41 ERROR [app] TypeError exception thrown during analysis #17. ["message" => "Argument 1 passed to Docker\DockerClient::createFromEnv() must be an instance of Http\Client\Common\PluginClientFactory or null, array given, called in /code/src/AppBundle/Httplug/ClientFactory/CallableClientFactory.php on line 34","code" => 0,"file" => "/code/vendor/docker-php/docker-php/src/DockerClient.php","line" => 64] []
As Docker\DockerClient have to support the unix:// scheme, the only Http\Client\HttpClient you can use is the SocketClient. So, you can either not rely on HttplugBundle and provide customization options with this library or allow any Http\Client\HttpClient implementation and let it fail if scheme is unix:// and client not a SocketClient.
As Docker\DockerClient have to support the unix:// scheme, the only Http\Client\HttpClient you can use is the SocketClient
I quite agree. But have to notice that if somebody create another client supporting unix://, it will not able to be added. Am I right? But maybe not a big deal. Here, we have some customization that are currently not used at all.
3.x accepts any PSR-18 client in Docker::create(), so a client configured as a Symfony service can be passed in directly. We don't plan to ship a Symfony bundle in this package.
Activity
joelwurtz commentedon Oct 20, 2017
Sorry for late answer, goal is to provide here a symfony integration by using the
PluginClientFactoryfrom php-httpsoullivaneuh commentedon Oct 22, 2017
Yes. But I think we should require
php-http/httplug-bundlein this case, and some adjustment might be done to make it easier.I currently have an implementation. but it's quite tricky:
Config:
See also php-http/HttplugBundle#210.
joelwurtz commentedon Oct 22, 2017
Would prefer to have a suggest for the bundle with the integration directly in this lib, so not required to use docker-php but suggested when using in cujunction with symfony
soullivaneuh commentedon Oct 22, 2017
@joelwurtz It would obviously be a suggestion as this library is not a bundle.
It's the concept of a bridge. ;-)
Example: https://github.com/Soullivaneuh/IsoCodesValidator/tree/fc143a075c2b379dd1bf6147d2848071cabccff8/src/Bridge
joelwurtz commentedon Oct 22, 2017
cac4840
I believe this is enough for the next version of httplug bundle
soullivaneuh commentedon Oct 22, 2017
Maybe, have to try. 😉
soullivaneuh commentedon Oct 23, 2017
@joelwurtz I don't really see how this commit will make things simpler, could you please elaborate?
At the end, I still have to call
DockerClient::createFromEnvmanually or on the services, but how can I manage it from the bundle configuration? Assuming this:How can I manage to add, for example, the logger plugin?
AFAIK, the logic should be reversed and the socket client be called as a service from here. This is why I was talking about a bridge.
A I wrong?
soullivaneuh commentedon Oct 23, 2017
I finish to end up with this:
And I indeed got a profiling and logging.
Is it what you was thinking about?
soullivaneuh commentedon Oct 23, 2017
Another weird thing: The
Docker\Docker::createmethod takes the version as first argument. But the previous service configuration works... plus, I tried to pass a specific version to test:But the version is stuck at
1.32.soullivaneuh commentedon Oct 23, 2017
Ok so just forgot the two past comments, the configuration was wrong.
Fun facts: If i do:
It works, but with 0 log.
If I remove the built http-client:
I got this exception:
It's seems the library factory got a curl client.
I have no more ideas at the moment. I'll wait an answer before trying to do anything else on this library. 😉
soullivaneuh commentedon Oct 23, 2017
Well, last thing, this is even worst. I rolled back to my current config:
And this is not working anymore:
joelwurtz commentedon Oct 24, 2017
Will try to see what the fucks happens, but i believe this :
is the correct solution
joelwurtz commentedon Oct 24, 2017
ping @fbourigault maybe he have some input on this
fbourigault commentedon Oct 24, 2017
As
Docker\DockerClienthave to support theunix://scheme, the onlyHttp\Client\HttpClientyou can use is theSocketClient. So, you can either not rely on HttplugBundle and provide customization options with this library or allow anyHttp\Client\HttpClientimplementation and let it fail if scheme isunix://and client not aSocketClient.soullivaneuh commentedon Oct 25, 2017
I quite agree. But have to notice that if somebody create another client supporting
unix://, it will not able to be added. Am I right? But maybe not a big deal. Here, we have some customization that are currently not used at all.@joelwurtz This solution looks nice. php-http/HttplugBundle#210 (comment)
Would you let me give a try on a PR?
joelwurtz commentedon Oct 26, 2017
Yes go ahead
As i'm not using docker with symfony ATM as long as it play nice and looks correct i will gladly merge this.
soullivaneuh commentedon Oct 26, 2017
Good to hear that, I'll give a try while working on my project, thanks.
Rid commentedon Oct 8, 2026
Closing as part of triage for the 3.x release.
3.x accepts any PSR-18 client in
Docker::create(), so a client configured as a Symfony service can be passed in directly. We don't plan to ship a Symfony bundle in this package.