Got this docker command I want to run. Note the tail command at the end for keeping the container up and running.
docker run -d --name xxxyyyzzz-blah alpine /bin/ash -c "/usr/bin/tail
+-f /dev/null"
The following backtick operation runs this command with no issue and the container is detached from and the container is left still running:
use v5.38;
`docker run -d --name xxxyyyzzz-blah alpine /bin/ash -c "/usr/bin/tail
+ -f /dev/null"`;
However, with the IPC::Run3 module, the container gets set up, but the tail command never seems to get executed and the container exits immediately:
use v5.38;
use IPC::Run3;
my $cmd = [ 'docker', 'run', '-d', '--name', 'xxxyyyzzz-blah', 'alpine
+', '/bin/ash', '-c', '"/usr/bin/tail -f /dev/null"' ];
my ($out, $err);
my $success = run3($cmd, undef, \$out, \$err);
print $success; # prints 1
I tried breaking up the the last element into 3 different elements separated by spaces but that didn't help.
|
Returning data
5 direct replies — Read more / Contribute
|
by frank1
on Apr 20, 2024 at 15:46
|
({
"items": [
{
"title": "Valls"
},
{
"title": "AUT15605"
},
{
"title": "10UT15605"
}
]
})
Am getting this error with my code
Can't modify private hash in concatenation (.) or string
my $dbh = DBI->connect("DBI:mysql:$dbname:$host", $usr, $pwd, {
RaiseError => 1,
}) or die $DBI::errstr;
my $sth = $dbh->prepare("SELECT titles FROM tbl_1");
$sth->execute();
my $Data = $sth->fetchall_arrayref();
my %output;
foreach my $Data (@$Data) {
my ($title) = @$Data;
%output .= (
'items' => [("title" => "$title")]
);
}
my $results = to_json(\%output);
print "Content-type: text/html\n\n";
print $results;
|
how to use find() options
4 direct replies — Read more / Contribute
|
by ypreisler
on Apr 17, 2024 at 12:16
|
Hi Monks,
i am not able to follow symbolic links when using the find() command. it says on the manual that the 'follow' or 'follow_fast' option should be used but i don't understand how to use it together with the '\&wanted' routine -
use File::Find;
find(\&wanted, @directories);
find(\%options, @directories);
thanks a lot, Yaron.
|
Imager font problem
3 direct replies — Read more / Contribute
|
by Anonymous Monk
on Apr 16, 2024 at 17:04
|
Dear Monks, I'm using Imager to render truetype fonts but there is no output, and no error, it's just blank. I checked $Imager::formats{tt} to see if Imager has truetype support and it's blank. I have some /usr/share/fonts/truetype so I dunno why Imager says that. How can Imager be compiled with tt support?
I have another computer with a similar setup but on that one Imager does render truetype even though $Imager::formats{tt} is blank! They are different operating systems and versions of Imager so I don't know. I could install the only fonts that Imager supports on this box: Freetype2, but I want to use truetype and would appreciate any ideas you have on how to get Imager to use my fonts. Thank you.
|