Skip to content

Commit

Permalink
Fix devc permissions issues for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Aug 31, 2023
1 parent 31db687 commit 992cd49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1328,9 +1328,12 @@ private void checkDockerBuildTime(long startTime, File dockerBuildContext) {

private void startContainer() {
try {
if (OSUtil.isLinux()) {
if (OSUtil.isLinux() || OSUtil.isMac()) { // Added Mac since started getting permission errors for logs folder
// Allow the server to write to the log files. If we don't create it here docker daemon will create it as root.
runCmd("mkdir -p " + serverDirectory + "/logs");
// Added two hidden folders since started getting permissions errors on the dropins folder.
runCmd("mkdir -p " + buildDirectory + "/" + DEVC_HIDDEN_FOLDER + "/apps");
runCmd("mkdir -p " + buildDirectory + "/" + DEVC_HIDDEN_FOLDER + "/dropins");
}

info("Starting Docker container...");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2018, 2020.
* (C) Copyright IBM Corporation 2018, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,4 +38,14 @@ public static boolean isLinux() {
return osName.indexOf("linux") >= 0;
}

/**
* Determines if the current OS is a MAC OS.
*
* @return true if running on Mac, false otherwise
*/
public static boolean isMac() {
String osName = System.getProperty("os.name", "unknown").toLowerCase();
return osName.indexOf("mac") >= 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static int compareArtifactVersion(String currentVersion, String compareVe
Version minVersion = new Version(majorVersion, minorVersion, patchLevel, null, null, null);

// check for and strip off any classifier
currentVersion = currentVersion.trim(); // guard against trailing blank space
if (currentVersion.contains("-")) {
currentVersion = currentVersion.substring(0, currentVersion.indexOf("-"));
}
Expand Down

0 comments on commit 992cd49

Please sign in to comment.