crops / docker-win-mac-docs

The wiki explains how to use docker containers created to run Yocto Project tools in a Windows or Mac environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need instructions for Docker (not toolbox) and Windows 10

artk2002 opened this issue · comments

The Windows instructions are for using Docker Toolbox which is deprecated on Win 10. Although most of the instructions can be sussed out, there is one issue that isn't clear.

Following the directions as written, starting the Samba container results in a permission error accessing port 445. Directions on how to work past that issue for Win 10 would be greatly appreciated.

Hi,

I cannot create a docker container in Windows 10 Pro with:

C:\Users\hebh>docker run -it -v projects:/projects crops/poky --workdir=/projects                                         
Refusing to use a gid of 0                                                                                                
Traceback (most recent call last):                                                                                        
  File "/usr/bin/usersetup.py", line 62, in <module>                                                                      
    subprocess.check_call(cmd.split(), stdout=sys.stdout, stderr=sys.stderr)                                              
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call                                                        
    raise CalledProcessError(retcode, cmd)                                                                                
subprocess.CalledProcessError: Command '['sudo', 'restrict_groupadd.sh', '0', 'pokyuser']' returned non-zero exit status 1                                                                                                                          
C:\Users\hebh> docker info
Containers: 5
 Running: 1
 Paused: 0
 Stopped: 4
Images: 108
Server Version: 18.06.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.768GiB
Name: linuxkit-00155d068747
ID: U57C:KKOK:BVPC:XPUO:RVQH:JX2T:A6LU:RR3A:G4PM:NZGK:WART:C5FH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 29
 Goroutines: 55
 System Time: 2018-08-13T13:42:58.4645413Z
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false


C:\Users\hebh>                                                                                                             

Thank you.

/Henrik

The Windows instructions are for using Docker Toolbox which is deprecated on Win 10. Although most of the instructions can be sussed out, there is one issue that isn't clear.

Following the directions as written, starting the Samba container results in a permission error accessing port 445. Directions on how to work past that issue for Win 10 would be greatly appreciated.

Giving some more in depth knowledge on the issue, that I discovered. If you look at your windows firewall (Windows Definder Firewall with Advance Security) you'll see DockerSmbMount already up and running and using 445. Turns out, Docker for Windows will start a VM by default called MobyLinuxVM, which you can see in the Hyper-V Manager, and samba is already setup for it. Which you can verify by opening up a file explorer and typing in \\10.0.75.1 where you'll see a network folder.

So this is just insight for people running into the permission error and just more info for someone who might be able to generate new instructions for Docker for Windows.

@HenrikBach1
I was able to recreate your problem just by simply running the first command. You didn't mention any other commands before running it so I'm assuming you did run it but might have had typos between creating your volume and running the container.

Commands to run
docker volume create --name projects
docker run -it --rm -v projects:/projects busybox chown -R 1000:1000 /projects
docker run -it -v projects:/projects crops/poky --workdir=/projects

@prosperv
Thank you. Ok. Next time, I'll bear in mind, what you proposed.

It seems using crops on windows is impossible now. Docker toolbox is deprecated and one can't get it anymore, and those instructions won't work with Docker desktop, because we can't run samba because of host already running samba on the same port. It's not about instructions anymore, whole approach needs to be changed.

Although I don't have a copy of Windows 10 Home to test, according to https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq#does-wsl-2-use-hyper-v-will-it-be-available-on-windows-10-home, WSL 2 should be available on Windows 10 Home.

Back in the day, the availability of Docker Toolbox on all version of Windows is what led its suggestion. However, the workflow/ease/ubiquity of WSL 2 means that it's probably the most logical replacement.

I've ran builds using WSL 2 once or twice, but I'm far from an expert. I would like to write up some new instructions, but I can't promise a timeline, because it's based on my free cycles.