---
title: WindowsでElixir/Nervesやるならdevcontainerでしょ！
tags: 
author: [MATSUOKA Takashi](https://convert.docswell.com/user/matsujirushi)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/P7R2V5LNJ9.jpg?width=480
description: 2020/7/10 【オンライン】Elixir/Nerves入門！堅牢なIoT Edgeデバイスプログラミングをお手軽に https://algyan.connpass.com/event/180192/
published: July 10, 20
canonical: https://convert.docswell.com/s/matsujirushi/538QXE-2024-01-17-214620
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/P7R2V5LNJ9.jpg)

Windowsで
Elixir/Nervesやるなら
devcontainerでしょ！
2020/7/10
Takashi Matsuoka


# Page. 2

![Page Image](https://bcdn.docswell.com/page/PJXDZKW8EX.jpg)

Takashi Matsuoka
(@matsujirushi12)
2017～ MVP for Windows Development
2020～
for Microsoft Azure
Seeed株式会社所属
ソフトウェア担当
在宅勤務
子育て中
「e」3つ


# Page. 3

![Page Image](https://bcdn.docswell.com/page/3JKX85VLED.jpg)

堅牢な組込みソフトウェアをElixirでお手軽に開発！
Platform:
たったの12MBでLinuxブートローダと
Erlang VM/Elixir実行環境を実現！
Framework:
ネットワーク，I/Oなどのデバドラ機能を提供！
Tooling:
mix new対応ですぐにプロジェクト開発を開始！
https://qiita.com/takasehideki/items/94820516ec95b85bae32


# Page. 4

![Page Image](https://bcdn.docswell.com/page/LE352KM6J5.jpg)

Windows Subsystem for Linux 2
Ubuntu
sudo apt install build-essential automake ...
git clone .../asdf.git
echo -e &#039;\n. $HOME/.asdf/asdf.sh&#039; &gt;&gt; ~/.bashrc
echo -e &#039;\n. $HOME/.asdf/completions/asdf.bash&#039; &gt;&gt; ~/.bashrc # optional
source ~/.bashrc
...
adsf plugin-add erlang
adsf plugin-add elixir
https://hexdocs.pm/nerves/installation.html


# Page. 5

![Page Image](https://bcdn.docswell.com/page/8EDDZ36MEG.jpg)



# Page. 6

![Page Image](https://bcdn.docswell.com/page/V7PXD4YQE8.jpg)



# Page. 7

![Page Image](https://bcdn.docswell.com/page/2JVL1XGP7Q.jpg)

事前準備
1. Windows 10 バージョン2004以降
2. Windows Subsystem for Linux 2
3. Docker Desktop for Windows
4. Visual Studio Code
•
Remote - Containers


# Page. 8

![Page Image](https://bcdn.docswell.com/page/5EGX2V8QJL.jpg)

事前準備 1/4
1. Windows 10 バージョン2004以降
https://www.microsoft.com/ja-jp/software-download/windows10
winver実行結果


# Page. 9

![Page Image](https://bcdn.docswell.com/page/4JQ8P69W7P.jpg)

事前準備 2/4
2. Windows Subsystem for Linux 2
https://docs.microsoft.com/ja-jp/windows/wsl/install-win10
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2


# Page. 10

![Page Image](https://bcdn.docswell.com/page/K742Y4X1J1.jpg)

事前準備 3/4
3. Docker Desktop for Windows
https://www.docker.com/products/docker-desktop


# Page. 11

![Page Image](https://bcdn.docswell.com/page/LJ1M64N5EG.jpg)

事前準備 4/4
4. Visual Studio Code
•
Remote - Containers
https://code.visualstudio.com/
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers


# Page. 12

![Page Image](https://bcdn.docswell.com/page/GJW3WX4WJ2.jpg)

事前準備 推し記事
https://uepon.hatenadiary.com/entry/2020/06/14/200918


# Page. 13

![Page Image](https://bcdn.docswell.com/page/4EZV5622J3.jpg)

Nerves用devcontainerをコピー
https://github.com/matsujirushi/nerves-devcontainer


# Page. 14

![Page Image](https://bcdn.docswell.com/page/Y7659L66EV.jpg)

VSCodeでdevcontainerを開く


# Page. 15

![Page Image](https://bcdn.docswell.com/page/G75YN16574.jpg)

ファイルシステム
Windows
Docker Container (Ubuntu)
C:\Windows
/bin
C:\Program Files
/boot
C:\Users
/dev
...
/etc
...\nerves-devcontainer
/home
/lib
/lib64
/media
/mnt
...
/workspaces/nerves-devcontainer


# Page. 16

![Page Image](https://bcdn.docswell.com/page/9J2G51MGJR.jpg)

マイクロSDへの書き込み
C:\&gt; fwup.exe C:\...\hello_nerves.fw


# Page. 17

![Page Image](https://bcdn.docswell.com/page/DEYVKZXGEM.jpg)



# Page. 18

![Page Image](https://bcdn.docswell.com/page/VJNMR31878.jpg)



