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

Mount /etc/localtime on macOS with Orbstack #196

Merged
merged 6 commits into from
Aug 11, 2024
Merged
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
12 changes: 3 additions & 9 deletions exegol/model/ContainerConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,23 +1004,17 @@ def addVolume(self,
# Docker Desktop for Windows based on WSL2 don't have filesystem limitation
if EnvInfo.isMacHost():
# Add support for /etc
# TODO check if path_match + replace really useful , path_match rever used
path_match = host_path
if path_match.startswith("/opt/") and EnvInfo.isOrbstack():
if host_path.startswith("/opt/") and EnvInfo.isOrbstack():
msg = f"{EnvInfo.getDockerEngine().value} cannot mount directory from /opt/ host path."
if path_match.endswith("entrypoint.sh") or path_match.endswith("spawn.sh"):
if host_path.endswith("entrypoint.sh") or host_path.endswith("spawn.sh"):
msg += " Your exegol installation cannot be stored under this directory."
logger.critical(msg)
raise CancelOperation(msg)
if path_match.startswith("/etc/"):
if EnvInfo.isOrbstack():
raise CancelOperation(f"{EnvInfo.getDockerEngine().value} doesn't support sharing /etc files with the container")
path_match = path_match.replace("/etc/", "/private/etc/")
if EnvInfo.isDockerDesktop():
match = False
# Find a match
for resource in EnvInfo.getDockerDesktopResources():
if path_match.startswith(resource):
if host_path.startswith(resource):
match = True
break
if not match:
Expand Down