diff --git a/src/docker/api_blueprint.go b/src/docker/api_blueprint.go index 5017f76..80a6828 100644 --- a/src/docker/api_blueprint.go +++ b/src/docker/api_blueprint.go @@ -418,10 +418,9 @@ func CreateService(serviceRequest DockerServiceCreateRequest, OnLog func(string) if _, err := os.Stat("/mnt/host"); os.IsNotExist(err) { utils.Error("CreateService: Unable to create directory for bind mount in the host directory. Please mount the host / in Cosmos with -v /:/mnt/host to enable folder creations, or create the bind folder yourself", err) OnLog(fmt.Sprintf("[ERROR] Unable to create directory for bind mount in the host directory. Please mount the host / in Cosmos with -v /:/mnt/host to enable folder creations, or create the bind folder yourself: %s\n", err.Error())) - Rollback(rollbackActions, OnLog) - return err + } else { + newSource = "/mnt/host" + newSource } - newSource = "/mnt/host" + newSource } utils.Log(fmt.Sprintf("Checking directory %s for bind mount", newSource)) diff --git a/src/docker/docker.go b/src/docker/docker.go index 3217fab..ad4de40 100644 --- a/src/docker/docker.go +++ b/src/docker/docker.go @@ -142,9 +142,9 @@ func EditContainer(oldContainerID string, newConfig types.ContainerJSON, noLock if os.Getenv("HOSTNAME") != "" { if _, err := os.Stat("/mnt/host"); os.IsNotExist(err) { utils.Error("EditContainer: Unable to create directory for bind mount in the host directory. Please mount the host / in Cosmos with -v /:/mnt/host to enable folder creations, or create the bind folder yourself", err) - return "", errors.New("Unable to create directory for bind mount in the host directory. Please mount the host / in Cosmos with -v /:/mnt/host to enable folder creations, or create the bind folder yourself") + } else { + newSource = "/mnt/host" + newSource } - newSource = "/mnt/host" + newSource } utils.Log(fmt.Sprintf("Checking directory %s for bind mount", newSource))