OSX_COMMANDS vs command in terminal #359

Open
opened 2025-12-29 00:25:17 +01:00 by adam · 2 comments
Owner

Originally created by @manang on GitHub (May 4, 2022).

Hi, I'm trying to use OSX_COMMANDS to execute a script.
this is my command:

DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH=/home/jenkins/docker-osx/mac_hdd_ng_auto_big_sur.img
docker run -i \
    --name ios-toolchain-build \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${SHARE}:/mnt/hostshare" \
    -e "OSX_COMMANDS=/bin/zsh -c \"echo alpine | sudo -S mount_9p hostshare && ls /Volumes/hostshare/ &&  /Volumes/hostshare/ci/build.sh \"" \
    -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=user" \
    -v "${DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH}:/image" \
    sickcodes/docker-osx:naked-auto

but if I run the command via ssh, the outcome is different, I have different variables

this is the way I run the container

DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH=/home/jenkins/docker-osx/mac_hdd_ng_auto_big_sur.img
docker run -i \
    --name ios-toolchain-build \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${SHARE}:/mnt/hostshare" \
    -e "OSX_COMMANDS=/bin/zsh -c \"echo alpine | sudo -S mount_9p hostshare && ls /Volumes/hostshare/ &&  /Volumes/hostshare/ci/build.sh \"" \
    -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=user" \
    -v "${DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH}:/image" \
    sickcodes/docker-osx:naked

why does it happen?
the qemu is the same.
The problem is that in the second case it works well, in the first case I obtain an error and I don't undersand why
Thanks a lot

Angelo

Originally created by @manang on GitHub (May 4, 2022). Hi, I'm trying to use OSX_COMMANDS to execute a script. this is my command: ``` DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH=/home/jenkins/docker-osx/mac_hdd_ng_auto_big_sur.img docker run -i \ --name ios-toolchain-build \ --device /dev/kvm \ -p 50922:10022 \ -v "${SHARE}:/mnt/hostshare" \ -e "OSX_COMMANDS=/bin/zsh -c \"echo alpine | sudo -S mount_9p hostshare && ls /Volumes/hostshare/ && /Volumes/hostshare/ci/build.sh \"" \ -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=user" \ -v "${DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH}:/image" \ sickcodes/docker-osx:naked-auto ``` but if I run the command via ssh, the outcome is different, I have different variables this is the way I run the container ``` DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH=/home/jenkins/docker-osx/mac_hdd_ng_auto_big_sur.img docker run -i \ --name ios-toolchain-build \ --device /dev/kvm \ -p 50922:10022 \ -v "${SHARE}:/mnt/hostshare" \ -e "OSX_COMMANDS=/bin/zsh -c \"echo alpine | sudo -S mount_9p hostshare && ls /Volumes/hostshare/ && /Volumes/hostshare/ci/build.sh \"" \ -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=user" \ -v "${DOCKER_OSX_QEMU_BIGSUR_IMAGE_PATH}:/image" \ sickcodes/docker-osx:naked ``` why does it happen? the qemu is the same. The problem is that in the second case it works well, in the first case I obtain an error and I don't undersand why Thanks a lot Angelo
Author
Owner

@sickcodes commented on GitHub (May 14, 2022):

Try this for sharing instead, it eats the mount_9p alive:

mkdir ~/mnt/osx
sshpass -p alpine sshfs user@localhost:/ -p 50922 ~/mnt/osx
@sickcodes commented on GitHub (May 14, 2022): Try this for sharing instead, it eats the mount_9p alive: ``` mkdir ~/mnt/osx sshpass -p alpine sshfs user@localhost:/ -p 50922 ~/mnt/osx ```
Author
Owner

@danrossi commented on GitHub (May 26, 2023):

ssh / sftp works via that forwarded port. But win ssh fails to work with a port added. It's broken

\\sshfs.r\danielr@localhost!50922/
@danrossi commented on GitHub (May 26, 2023): ssh / sftp works via that forwarded port. But win ssh fails to work with a port added. It's broken ``` \\sshfs.r\danielr@localhost!50922/ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#359