savoirfairelinux / cqfd

cqfd helps running commands inside the Docker container configured for your project, keeping the user and working directory the same inside the container
GNU General Public License v3.0
64 stars 31 forks source link

macOS: `cqfd run` error while creating mount source path #105

Open rbrule opened 1 year ago

rbrule commented 1 year ago

Setup

With this Dockerfile:

FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    bash \
    git \
    sudo

I was able to create the image with cqfd init. However, I am not able to cqfd run bash for example.

Here's the error I get:

docker: Error response from daemon: error while creating mount source path '/host_mnt/private/tmp/com.apple.launchd.bMzWTSF9Hd/Listeners': mkdir /host_mnt/private/tmp/com.apple.launchd.bMzWTSF9Hd/Listeners: operation not supported.

I tried adding /host_mnt to the filesharingDirectories list in ~/Library/Group\ Containers/group.com.docker/settings.json, but it seems then I get:

ERROR: Cannot connect to the Docker daemon at unix:///Users/rbrule/.docker/run/docker.sock. Is the docker daemon running?

when doing cqfd init.

Update

I've found a workaround:

@@ -218,7 +218,6 @@ docker_run() {
               -v "$cqfd_project_dir":"$cqfd_project_dir" \
               ${home_env_var:+ -e "$home_env_var"} \
               $interactive_options \
-              ${SSH_AUTH_SOCK:+ -v $SSH_AUTH_SOCK:"$cqfd_user_home"/.sockets/ssh} \
               ${SSH_AUTH_SOCK:+ -e SSH_AUTH_SOCK="$cqfd_user_home"/.sockets/ssh} \
               $docker_img_name cqfd_launch "$@" 2>&1
 }
joufellasfl commented 6 months ago

@rbrule does this issue still occur with the current HEAD of the master branch ?

rbrule commented 6 months ago

It doesn't work on v5.5.0, I had to :

diff --git a/cqfd b/cqfd
index ef3c062..4891a11 100755
--- a/cqfd
+++ b/cqfd
@@ -240,11 +240,6 @@ docker_run() {
                args+=(-v /etc/ssh:/etc/ssh)
        fi

-       if [ "$SSH_AUTH_SOCK" ]; then
-               args+=(-v "$SSH_AUTH_SOCK:$cqfd_user_home/.sockets/ssh")
-               args+=(-e "SSH_AUTH_SOCK=$cqfd_user_home/.sockets/ssh")
-       fi
-
        args+=(-v "$cqfd_project_dir:$cqfd_project_dir")

        tmp_launcher=$(make_launcher)

to make it work.