Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Support for WSL #5

Open
lars18th opened this issue Feb 27, 2019 · 2 comments
Open

Support for WSL #5

lars18th opened this issue Feb 27, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lars18th
Copy link

Hi,

This tool is great! Thank you @Andy2244 for it! 👍

However, it has troubles when running in:

  • Windows 10 with WSL and Docker for Windows in Linux mode.

Let me to explain:

  • I hate PowerShell, this shell is a pain! I prefer to use Bash in WSL.
  • To run the builder.ps1 in Windows 10 you need to execute first powershell Set-ExecutionPolicy Unrestricted, and this isn't documented!
  • When running the powershell script with Docker for Windows (and not with Windows Containers) then you found this error:
    Error response from daemon: invalid mount config for type "bind": invalid mount path: 'C:/Users/me/openwrt/openwrt-package-builder-1.0.2' mount path must be absolute
  • I can't switch to Windows Containers as my current environment uses Docker for Windows using the regular mode for running other docker images. So the switch is impossible.
  • When executing the script builder.sh inside WSL you have troubles with sudo as it doesn't exists.
  • When executing the script builder.sh inside WSL you have troubles as the command "docker" doesn't call to "docker.exe" (the native executable). You need to declare alias docker=docker.exe.
  • When executing the script builder.sh inside WSL you have troubles as the script detects some syntax errors.

So, in this enviroment these scripts are useless.
I suggest to improve it in one of these ways:

  1. Add support for WSL with a new builder-wsl.sh script.
  2. OR, add support in builder.ps1 for Docker for Windows and document the powershell Set-ExecutionPolicy Unrestricted requirement.
  3. OR, enhance the builder.sh script to support: different docker binary, Windows host, etc.
  4. OR, move the script to a docker image with docker-in-docker.

I don't know what's the best. I hope you will consider at some point to implement one of them.
Thank you for this project!

@Andy2244
Copy link
Owner

Andy2244 commented Feb 27, 2019

Yeah WSL was really buggy when i started the package builder, as workaround you should be able to easily switch between windows/linux containers via tray icon, build the package and switch back. Last time i tried this it worked without problems. Alternative i use a ClearLinux VM, which can be setup in a couple of minutes, since they have a ready to download hyper-v image.

PS: I already have to test 3 versions (Win10, Linux, Mac) and since i don't use WSL would like to avoid having to maintain/test a extra version. As you noticed invoking the native windows docker version from within WSL is kinda tricky and the native linux version does not work in WSL as far as i know.

@Andy2244 Andy2244 self-assigned this Feb 27, 2019
@Andy2244 Andy2244 added the enhancement New feature or request label Feb 27, 2019
@lars18th
Copy link
Author

Hi @Andy2244 ,

Thank you very much for your clear and gentle explanation.
I don't want to push more effort for you going to 4 versions. I feel it will be useless.

However, as an enchancement, think on the scenario 4 for the future: a dockerized version of the script.
I feel the problem is the permanent storage for the cache. I'm right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants