Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mix burn cannot be operated from Docker container #5

Closed
takasehideki opened this issue Nov 24, 2020 · 3 comments
Closed

mix burn cannot be operated from Docker container #5

takasehideki opened this issue Nov 24, 2020 · 3 comments

Comments

@takasehideki
Copy link
Member

It is nature that burning firmware to microSD from Docker container is hard to support.
But it become awesome if mix burn can be operated from docker dev-container.

@takasehideki
Copy link
Member Author

takasehideki commented Nov 24, 2020

Status on macOS

root@be6d80382017:/workspaces/nerves-devcontainer/test# mix burn 
==> nerves
==> test

Nerves environment
  MIX_TARGET:   rpi4
  MIX_ENV:      dev

** (Mix) Could not auto detect your SD card

This is because Docker container cannot access/detect microSD on host PC. One possible solution is calling fwup on host PC from Docker container. Alternatively, binding microSD device to docker container filesystem. But, are they possible?

@takasehideki
Copy link
Member Author

takasehideki commented Nov 24, 2020

status on windows:

root@923930b7aad1:/workspaces/nerves-devcontainer/test# mix burn 
==> nerves
==> test

Nerves environment
  MIX_TARGET:   rpi4
  MIX_ENV:      dev

** (ErlangError) Erlang error: :enoent
    (nerves 1.7.0) lib/nerves/port.ex:88: Nerves.Port.validate("cmd.exe", ["/c", "echo %TEMP%"], [])
    (nerves 1.7.0) lib/nerves/port.ex:25: Nerves.Port.do_cmd/4
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:94: Nerves.Utils.WSL.get_temp_file_location/1
    (nerves 1.7.0) lib/nerves/utils/wsl.ex:237: Nerves.Utils.WSL.make_file_accessible/3
    (nerves 1.7.0) lib/mix/tasks/burn.ex:66: Mix.Tasks.Burn.run/1
    (mix 1.11.2) lib/mix/task.ex:394: Mix.Task.run_task/3
    (mix 1.11.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2

This is because current Nerves supports (native) WSL2 environment for Windows users. We may modify Nerves environment to resolve this situation.
The way to detect whether a container is based on WSL2 or native docker is uname -r and ls /.dockerenv
Ref: https://github.com/ETrobocon/etrobo/blob/master/scripts/etroboenv.sh#L55

@takasehideki
Copy link
Member Author

This issue was transferred to more precise repository.
NervesJP/docker-nerves#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant