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

Support for non-standard paths under Mac filesystem root (/) #435

Closed
f3l1x opened this issue Jul 11, 2023 · 7 comments
Closed

Support for non-standard paths under Mac filesystem root (/) #435

f3l1x opened this issue Jul 11, 2023 · 7 comments
Labels
f/containers Affects container users t/improvement Minor improvement
Milestone

Comments

@f3l1x
Copy link

f3l1x commented Jul 11, 2023

Describe the bug
Using docker compose volumes is not working properly. Using native docker run -v $(pwd):/srv image works good.

To Reproduce

  1. Prepare docker-compose.yml.
version: "3.5"
services:
    app:
        image: debian:bullseye
        command: ["tail", "-f", "/dev/null"]
        volumes:
           - .:/srv
  1. Run docker compose up.
  2. Run docker exec -it folder-app-1 ls -la /srv

Expected behavior
See some files & folders in /srv.

Unexpected behavior
I see empty /srv folder.

Environment
MacOS: 13.4.1 (22F82)
Apple M1 ultra

❯ orb version
Version: 0.14.0 (140000)
Commit: 9a20727a93c7b42eb2e7b23cf815c2ecef334c76 (v0.14.0)
@f3l1x f3l1x added the t/bug Something isn't working label Jul 11, 2023
@kdrag0n
Copy link
Member

kdrag0n commented Jul 11, 2023

Can't reproduce:

❯ docker exec -it srvtest-app-1 ls -la /srv                                                                                                                                                                                                 ~
total 4
drwxr-xr-x 3 root root  96 Jul 11 12:30 .
drwxr-xr-x 1 root root   0 Jul 11 12:30 ..
-rw-r--r-- 1 root root 148 Jul 11 12:30 docker-compose.yml

Do you get the same result if you restart the Compose service? What does docker inspect srvtest-app-1 show?

@f3l1x
Copy link
Author

f3l1x commented Jul 11, 2023

Oh I see the problem using docker inspect folder-app-1.

I use /opt/code as symlink to my user folder. Therefor docker compose from /opt/code does not work, but starting from ~/Data/code/ works.

Should I add some settings somewhere?

@f3l1x
Copy link
Author

f3l1x commented Jul 11, 2023

I think it's same as for Docker Desktop -> https://docs.docker.com/desktop/settings/mac/#file-sharing

@kdrag0n
Copy link
Member

kdrag0n commented Jul 11, 2023

Unfortunately the only way to make that work right now is to manually create the symlink every time OrbStack starts. You could do it in docker-compose.yml though.

docker run -it --rm -v /:/host alpine ln -sf /Users/$USER/Data/code /host/opt/code

The plan is to remove the need for settings and hacks like this by automatically translating all Mac paths.

@f3l1x
Copy link
Author

f3l1x commented Jul 11, 2023

Got it, thank you for investigating.

@kdrag0n kdrag0n changed the title Empty folder using docker compose volumes mount Support for non-standard paths under Mac filesystem root (/) Jul 11, 2023
@kdrag0n kdrag0n added t/improvement Minor improvement f/containers Affects container users and removed t/bug Something isn't working labels Jul 11, 2023
@kdrag0n kdrag0n closed this as completed Jan 24, 2024
@kdrag0n kdrag0n added this to the v1.4.0 milestone Jan 24, 2024
@kdrag0n
Copy link
Member

kdrag0n commented Jan 24, 2024

Fixed for the next version.

@kdrag0n
Copy link
Member

kdrag0n commented Feb 2, 2024

Released in v1.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f/containers Affects container users t/improvement Minor improvement
Projects
None yet
Development

No branches or pull requests

2 participants