Open SIM0N-F opened 7 years ago
It's now OK for me :
I have add eval() for debug and I had this error :
'error_details' => 'Error produced in \'postContainers\' api call. Details: 500 - {"message":"json: cannot unmarshal string into Go value of type bool"}'
So i have changed
NetworkDisabled => "False",
to
NetworkDisabled => \0,
I also change 'portbinding' for 'portbindings' and added the bindings arguments in create function.
use strict;
use Data::Dumper;
use Eixo::Docker::Api;
my $a = Eixo::Docker::Api->new('http://127.0.0.1:4243');
# getAll
my $lista = $a->containers->getAll();
eval {
my $c = $a->containers->create(
Hostname => 'test',
Image => "trafex/alpine-nginx-php7",
Name => "php7",
NetworkDisabled => \0,
ExposedPorts => {
"80/tcp" => {}
},
HostConfig => {
"PortBindings" => { "80/tcp" => [{"HostIp" => "0.0.0.0", "HostPort" => "8100" }] },
},
);
my $container = $a->containers->getByName("php7");
$container->start(
"PortBindings" => { "80/tcp"=> [{"HostPort" => "80" }] },
);
};
print Dumper($@) if($@);
~
Hello,
I try make little script to build and start my PHP docker, for the moment my script is pretty simple but he stop working when I want enable network.
My script:
I have :
Eixo::Docker::ContainerException=HASH(0x3044888)
Could you help me please?
Many thanks by advance, Simon.