Skip to content

Commit af2b3eb

Browse files
authored
Merge pull request #6423 from BOINC/dpa_docker21
docker_wrapper (Mac/Linux): show appropriate error message if Docker not present
2 parents 92992ba + 7094e54 commit af2b3eb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/hostinfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ void HOST_INFO::clear_host_info() {
7878
wsl_distros.clear();
7979
#else
8080
safe_strcpy(docker_version, "");
81+
docker_type = NONE;
8182
safe_strcpy(docker_compose_version, "");
83+
docker_compose_type = NONE;
8284
#endif
8385

8486
safe_strcpy(product_name, "");

samples/docker_wrapper/docker_wrapper.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,18 @@ int main(int argc, char** argv) {
764764
boinc_finish(1);
765765
}
766766
#else
767-
docker_type = boinc_is_standalone()?PODMAN:aid.host_info.docker_type;
767+
if (boinc_is_standalone()) {
768+
docker_type = PODMAN;
769+
} else {
770+
if (!strlen(aid.host_info.docker_version)
771+
|| aid.host_info.docker_type == NONE
772+
) {
773+
fprintf(stderr, "Docker type missing from app_init_data.xml\n");
774+
fprintf(stderr, "Check project plan class configuration\n");
775+
boinc_finish(1);
776+
}
777+
docker_type = aid.host_info.docker_type;
778+
}
768779
docker_conn.init(docker_type, config.verbose>0);
769780
#endif
770781
fprintf(stderr, "Using %s\n", docker_type_str(docker_type));

0 commit comments

Comments
 (0)