Skip to content

Instantly share code, notes, and snippets.

@masahide
Last active January 27, 2020 05:11
Show Gist options
  • Save masahide/3db867cdfc6029dbcdb1ac2e2f4e1f9c to your computer and use it in GitHub Desktop.
Save masahide/3db867cdfc6029dbcdb1ac2e2f4e1f9c to your computer and use it in GitHub Desktop.

1.WSL(Windows Subsystem For Linux)を使うための設定をする

PowerShellを管理者として実行する

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  1. ubuntuインストール
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing
Add-AppxPackage -Path ~/Ubuntu.appx

3.WSL環境を「管理者として実行」して、Dockerをインストールする

一旦 WSLストップ

net stop LxssManager

install(docker 17.12.1-0ubuntu1 じゃないとエラーになる)

sudo apt update && sudo apt -y upgrade
sudo apt -y install docker.io=17.12.1-0ubuntu1
sudo cgroupfs-mount
sudo usermod -aG docker $USER

daemon起動スクリプト

#!/bin/bash
service rsyslog start
service ssh start
cgroupfs-mount
service docker start

WSL初回起動時は上記のスクリプトをsudoで実行する

エラー

※docker docker 17.12.1-0ubuntu1 より新しいバージョンで出るエラー 

$ docker run hello-world
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:301: running exec setns process for init caused \"exit status 23\"": unknown.
ERRO[0001] error waiting for container: context canceled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment