File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1242,12 +1242,17 @@ bool HOST_INFO::get_docker_version_aux(DOCKER_TYPE type){
12421242 FILE* f = popen (cmd.c_str (), " r" );
12431243 if (f) {
12441244 char buf[256 ];
1245- fgets (buf, 256 , f);
1246- std::string version;
1247- if (get_docker_version_string (type, buf, version)) {
1248- safe_strcpy (docker_version, version.c_str ());
1249- docker_type = type;
1250- ret = true ;
1245+ // normally the version is on the first line,
1246+ // but it's on the 2nd line if using podman-docker
1247+ //
1248+ while (fgets (buf, 256 , f)) {
1249+ string version;
1250+ if (get_docker_version_string (type, buf, version)) {
1251+ safe_strcpy (docker_version, version.c_str ());
1252+ docker_type = type;
1253+ ret = true ;
1254+ break ;
1255+ }
12511256 }
12521257 pclose (f);
12531258 }
@@ -1286,7 +1291,7 @@ bool HOST_INFO::get_docker_compose_version_aux(DOCKER_TYPE type){
12861291 if (f) {
12871292 char buf[256 ];
12881293 fgets (buf, 256 , f);
1289- std:: string version;
1294+ string version;
12901295 if (get_docker_compose_version_string (type, buf, version)) {
12911296 safe_strcpy (docker_compose_version, version.c_str ());
12921297 docker_compose_type = type;
You can’t perform that action at this time.
0 commit comments