Git Product home page Git Product logo

Comments (10)

if-kyle avatar if-kyle commented on August 15, 2024

running

docker run -v /Users/$(whoami)/asdasdasd:/asdasdasd -it ubuntu:xenial /bin/bash

Fails for me without having /Users in Preferences -> File sharing.

Are you sure this works outside of d4m, on osxfs?

The default nature for docker is to try to create the paths, thus on linux it makes sense that this works as you likely have access to your home dir.

** EDIT **

I see you are using etc/d4m-nfs-mounts.txt thus the reason your screenshot only has /tmp. Please ignore my above comment.

from d4m-nfs.

if-kyle avatar if-kyle commented on August 15, 2024

Please try updating etc/d4m-nfs-mounts.txt to only have the following line

/Users/alan:/mnt:0:0

re-run d4m-nfs.sh

and see if "docker run -v /Users/alan/asdasdasd:/asdasdasd -it ubuntu:xenial /bin/bash" works.

from d4m-nfs.

alanfranz avatar alanfranz commented on August 15, 2024

@if-kyle I have just tried; I experience the very same error.

from d4m-nfs.

alanfranz avatar alanfranz commented on August 15, 2024

but weren't you meaning, by chance:

"docker run -v /mnt/asdasdasd:/asdasdasd -it ubuntu:xenial /bin/bash"

?

Since you're proposing to mount my home in /mnt?

That last command, in fact, succeeds. What does not seem to succeed is something like:

docker run -v /mnt/asd123/asd123:/asdasdasd123 -it ubuntu:xenial /bin/bash

It looks like that via NFS we're just able to create ONE missing directory, not an entire directory tree. Does that make sense to you?

from d4m-nfs.

Mahmoudz avatar Mahmoudz commented on August 15, 2024

I'm experiencing the same error as well :)

❯ docker-compose up -d nginx mysql redis
Creating network "laradockmj5_default" with the default driver
Creating laradockmj5_mysql_1
Creating laradockmj5_redis_1
Creating laradockmj5_applications_1
Creating laradockmj5_workspace_1
Creating laradockmj5_php-fpm_1
Creating laradockmj5_nginx_1

ERROR: for nginx  Cannot start service nginx: Mounts denied: .com/docker-for-mac/osxfs/#namespaces for more info.
.
j/moubarmij/l5-code/laradock-mj5/logs/nginx
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker
ERROR: Encountered errors while bringing up the project.

from d4m-nfs.

if-kenn avatar if-kenn commented on August 15, 2024

@Mahmoudz you might be experiencing the same error as Alan, but you are quite a different setup. Please make sure to read the README, look at the examples and if you still have issues, create a new issue with all the requested information from the README.

from d4m-nfs.

if-kenn avatar if-kenn commented on August 15, 2024

@alanfranz it appears as though you are having the same problem as others, please review this from the README.md:

45f1628

from d4m-nfs.

alanfranz avatar alanfranz commented on August 15, 2024

Hello @if-kenn , thanks for your suggestion. But it doesn't seem related to my issue. In my Docker fro mac preferences, I still have just /tmp on osxfs. I tried exporting just /Users (which seems to have no symlinks around) and I still have the same issue as in my first post:

AlanMacbook:d4m-nfs alan$ docker run -v /Users/alan/asdasdasd:/asdasdasd -it ubuntu:xenial /bin/bash
docker: Error response from daemon: Mounts denied:
The path /Users/alan/asdasdasd
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

Debug log:

AlanMacbook:d4m-nfs alan$ cat etc/d4m-nfs-mounts.txt
# Be sure that any mounts that have been added here
# have been removed from Docker for Mac -> Preferences -> File Sharing
#
# You must supply the Mac source directory and Moby VM destination directory,
# and optionally add on user/group mapping:
#
# https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/exports.5.html
#
# <MAC_SRD_DIR>:<MOBY_VM_DST_DIR>[:MAC_UID_MAP][:MAC_GID_MAP]
#
/Users:/Users:0:0
AlanMacbook:d4m-nfs alan$ cat /tmp/d4m-mount-nfs.sh
ln -nsf /tmp/d4m-apk-cache /etc/apk/cache
apk update
apk add nfs-utils sntpc
rpcbind -s > /dev/null 2>&1

DEFGW=$(ip route|awk '/default/{print $3}')
FSTAB="\n\n# d4m-nfs mounts\n"

if false && ! $(grep ':/mnt' /tmp/d4m-nfs-mounts.txt > /dev/null 2>&1); then
  mkdir -p /mnt

  FSTAB="${FSTAB}${DEFGW}:/Users/root /mnt nfs nolock,local_lock=all 0 0"
fi

if [ -e /tmp/d4m-nfs-mounts.txt ]; then
  while read MOUNT; do
    DSTDIR=$(echo "$MOUNT" | cut -d: -f2)
    mkdir -p ${DSTDIR}
    FSTAB="${FSTAB}\n${DEFGW}:$(echo "$MOUNT" | cut -d: -f1) ${DSTDIR} nfs nolock,local_lock=all 0 0"
  done < /tmp/d4m-nfs-mounts.txt
fi

if ! $(grep "d4m-nfs mounts" /etc/fstab > /dev/null 2>&1); then
    echo adding d4m nfs config to /etc/fstab:
    echo -e $FSTAB | tee /etc/fstab
else
    echo d4m nfs mounts already exist in /etc/fstab
fi

sntpc -i 10 ${DEFGW} &

sleep .5
mount -a
touch /tmp/d4m-done
AlanMacbook:d4m-nfs alan$ cat /tmp/d4m-nfs-mounts.txt
/Users:/Users:0:0
AlanMacbook:d4m-nfs alan$ cat /etc/exports
# d4m-nfs exports

"/Users" -alldirs -mapall=0:0 localhost

from d4m-nfs.

if-kenn avatar if-kenn commented on August 15, 2024

I just did a bunch of testing. It looks like this is something out of our control at the d4m-nfs level. Docker looks to see if the volume exists, if it does not and it does exist where Docker for Mac can write to it will throw this error since it is not aware of the existence of the NFS volumes on the Mac provided d4m-nfs. So the error is a bit misleading in this context.

Bottom line is if you are looking to make directories on the fly, you are stuck with using Docker for Mac native.

from d4m-nfs.

alanfranz avatar alanfranz commented on August 15, 2024

OK. Thanks for all your support! I think it's ok, it's just good to know; maybe writing it in the README will help other people as well.

from d4m-nfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.