php -r "command" で可能
root@f1eb1edceb79:/var/www/html# php -r "print_r(gd_info());"
Array
(
[GD Version] => bundled (2.1.0 compatible)
[FreeType Support] =>
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] =>
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] =>
[XBM Support] => 1
[WebP Support] => 1
[BMP Support] => 1
[JIS-mapped Japanese Font Support] =>
)