Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix devc permissions issues for Docker #410

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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