質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

2回答

1337閲覧

dockerをうまくインストールできません。

abcdxyx

総合スコア17

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2019/12/30 06:25

編集2019/12/30 07:14

環境
windows10 Pro
WSL上のubuntu

 
dockerをインストールしたいのですが、どうもうまくいきません。

sudo apt install docker.io sudo cgroupfs-mount sudo usermod -aG docker $USER sudo service docker start sudo apt install docker-compose sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt install docker-ce docker-ce-cli containerd.io sudo docker run hello-world

上記のコードを実行したのですが、エラーが出て、Hello worldが実行できません。昨日は実行できたのですが、なぜか実行できず、尚且つ、sudo apt updateでエラーが出るようになりました。

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

See 'docker run --help'.

   

Hit:1 https://download.docker.com/linux/ubuntu bionic InRelease

Ign:2 https://download.docker.com/linux/ubuntu (lsb_release InRelease
Err:3 https://download.docker.com/linux/ubuntu (lsb_release Release
404 Not Found [IP: 13.35.50.98 443]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:5 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu (lsb_release Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:49 and /etc/apt/sources.list:51

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

手元のWSL(version 1)で一応動いている手順です。

dockerをバージョン指定して入れる

bash

1sudo apt install docker.io=17.12.1-0ubuntu1

Windowsのコマンドプロンプトを管理者権限で立ち上げてサービス起動
(ubuntuを管理者権限で立ち上げて sudo service docker startでも良いです)

bat

1wsl -u root service docker start 2

ただ、このやり方だとDockerfileでUSERが指定されている場合にコンテナの権限が足りなくて、docker run--user root しないと動かなかったりします。他にも問題があるかもしれません。

WSLにdocker最新版を入れた場合、私の環境でもサービスが起動できないです。

WSL2であれば通常通りの手順で動作しますが、これはWindows 10 20H1で追加される機能のため、現時点では
Windows Insider Program Slowリングに参加する必要があります

投稿2019/12/30 08:53

Eggpan

総合スコア2727

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

WSLの現行バージョンではDocker daemon動かすことはできないです。Windows10の次バージョン 20H1で使用できるWSL2ならば可能ではないでしょうか?
現行Win10バージョンで利用する場合はvirtualBoxやhyper−Vなどの上でLinux動かしてそこでDocker daemon動かせば出来ます。
WSL2を使用したい場合は個人的な責任の上でInsider Previewに参加して次のバージョンのWindowsにアップデートすれば良いです。

投稿2019/12/30 08:10

euledge

総合スコア2404

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問