diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/deliverable.c | 8 | ||||
| -rw-r--r-- | src/main.c | 14 | 
2 files changed, 15 insertions, 7 deletions
| diff --git a/src/deliverable.c b/src/deliverable.c index 4c29fa4..0729ff8 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -752,9 +752,11 @@ int delivery_init(struct Delivery *ctx) {          }      } -    if (docker_validate_compression_program(ctx->deploy.docker.image_compression)) { -        SYSERROR("[deploy:docker].image_compression - invalid command / program is not installed: %s", ctx->deploy.docker.image_compression); -        return -1; +    if (ctx->deploy.docker.image_compression) { +        if (docker_validate_compression_program(ctx->deploy.docker.image_compression)) { +            SYSERROR("[deploy:docker].image_compression - invalid command / program is not installed: %s", ctx->deploy.docker.image_compression); +            return -1; +        }      }      return 0;  } @@ -580,11 +580,17 @@ int main(int argc, char *argv[]) {      msg(OMC_MSG_L1, "Rendering mission templates\n");      delivery_mission_render_files(&ctx); +    char dockerfile[PATH_MAX] = {0}; +    sprintf(dockerfile, "%s/%s", ctx.storage.build_docker_dir, "Dockerfile");      if (globals.enable_docker) { -        msg(OMC_MSG_L1, "Building Docker image\n"); -        if (delivery_docker(&ctx)) { -            msg(OMC_MSG_L1 | OMC_MSG_ERROR, "Failed to build docker image!\n"); -            COE_CHECK_ABORT(1, "Failed to build docker image"); +        if (!access(dockerfile, F_OK)) { +            msg(OMC_MSG_L1, "Building Docker image\n"); +            if (delivery_docker(&ctx)) { +                msg(OMC_MSG_L1 | OMC_MSG_ERROR, "Failed to build docker image!\n"); +                COE_CHECK_ABORT(1, "Failed to build docker image"); +            } +        } else { +            msg(OMC_MSG_L1 | OMC_MSG_WARN, "Docker image building is disabled. No Dockerfile found in %s\n", ctx.storage.build_docker_dir);          }      } else {          msg(OMC_MSG_L1 | OMC_MSG_WARN, "Docker image building is disabled\n"); | 
