2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows Subsystem for Linux上でDockerを動かす

Posted at

Windows Subsystem for Linux上でdockerを動かす

前提条件

  • Windows Subsystem for Linux上で既にUbuntuが動作中。
  • Docker for Windowsをインストール済み。

必要パッケージ等準備

apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

プロキシ設定

プロキシの設定が必要であれば設定する。

apt-get設定

vi /etc/apt/apt.conf (なければ作成)
Acquire::ftp::proxy "ftp://username:password@your.proxy.address:proxy.port/";
Acquire::http::proxy "http://username:password@your.proxy.address:proxy.port/";
Acquire::https::proxy "https://username:password@your.proxy.address:proxy.port/";

curl設定

vi ~/.curlrc
proxy-user = "(ユーザ名):(パスワード)"
proxy = "http://proxy.xxx.co.jp:(ポート)"

Docker公式のGPG鍵を追加、確認

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt-key fingerprint 0EBFCD88

Docker リポジトリを追加

add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

Dockerインストール

apt-get update
apt-get install docker-ce

Docker for Windowsと連携する

echo "export DOCKER_HOST='tcp://0.0.0.0:2375'" >> ~/.bashrc
source ~/.bashrc
docker version

備考

  • systemd使う場合
apt-get install systemd

Docker for Windows プロキシ設定

プロキシの設定が必要であれば設定する。
・Setting > Proxices

PASSWORD@XXXXX.com:8080

参考URL(公式サイト)

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?