LoginSignup
8
9

More than 5 years have passed since last update.

Debian に Docker をインストールしたときのメモ

Last updated at Posted at 2016-01-09

はじめに

タイトルの通り,Debian に Docker をインストールしたので,その時のメモです.

環境

  • Debian 8.xxx
  • CD イメージをUSBメモリに焼いてインストール
  • インストール時,SSH server と Standard system utilities だけ選択してインストール

参考URL

基本的な手順は以下の Docker のサイトの通り.
Installation on Debian - https://docs.docker.com/engine/installation/debian/

いくつか追加で必要な手順があったので,それについては,この記事の下の方で説明を書いてみた.

とりあえずこのコマンド打てばインストールできたっていうやつ

# cd /etc/apt/
# cp sources.list sources.list.backup
# vi sources.list
# diff -u sources.list.backup sources.list
--- sources.list.backup 2016-01-09 21:32:27.012660129 +0900
+++ sources.list        2016-01-09 21:32:36.596706983 +0900
@@ -2,8 +2,6 @@

 # deb cdrom:[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 CD Binary-1 20150906-11:13]/ jessie main

-deb cdrom:[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 CD Binary-1 20150906-11:13]/ jessie main
-
 deb http://ftp.tsukuba.wide.ad.jp/debian/ jessie main
 deb-src http://ftp.tsukuba.wide.ad.jp/debian/ jessie main

# apt-get purge lxc-docker*
# apt-get purge docker.io*
# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# echo "deb https://apt.dockerproject.org/repo debian-wheezy main" >> /etc/apt/sources.list.d/docker.list
# apt-get install apt-transport-https
# apt-get update
# apt-get install docker-engine
# docker run hello-world

/etc/apt/sources.list の変更は何?

CD イメージから Debian をインストールすると,パッケージを CD から探しに行く設定がデフォルトで書かれている.
当然,いつまでも CD やら DVD やら USB メモリやら挿したままとか嫌なので,ネットの向こうからパッケージと取ってきてほしい.
なので,上の変更では, CD からパッケージを探しに行く設定を消している.
ネットの向こうからパッケージを探す設定は既に書かれているので,自分で足す必要はなかった.

apt-transport-https ?

apt-transport-https が何かはよく知らないが,これをインストールする前に apt-get update を叩くと以下のように怒られる.

# apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

=おわりに=
これで Docker のインストールできました.
めでたしめでたし.

8
9
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
8
9