App-dozo

 view release on metacpan or  search on metacpan

xt/author/docker_dozo.t  view on Meta::CPAN

        `$dozo -I $image -N $container -K 2>&1`;

        # Create live container with sleep to keep it running (detached)
        `docker run -d --name $container $image sleep 60 2>&1`;

        # Run command in existing running container
        my $out = `$dozo -I $image -N $container -L -B echo world 2>&1`;
        unlike($out, qr/create live container/, 'uses existing container');
        like($out, qr/world/, 'command runs via exec in running container');

        # Stop container and verify restart
        `docker stop $container 2>&1`;
        $out = `$dozo -I $image -N $container -L -B echo restarted 2>&1`;
        like($out, qr/restarting exited container $container/, 'restarts stopped container');

        # Kill and recreate
        $out = `$dozo -I $image -N $container -KL -B echo recreated 2>&1`;
        like($out, qr/removed|create live container/, 'kills and recreates');
        like($out, qr/recreated/, 'command runs in new container');

        # Clean up



( run in 2.232 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )