Help us understand the problem. What is going on with this article?

CentOS 6.7にdocker-engine 1.7をインストールする

More than 3 years have passed since last update.

余ってたCentOS6.7のマシンにdocker1.7を入れてみた。公式によると、docker1.8以上はCentOS7以上しかサポートしないみたい。

Docker requires a 64-bit installation regardless of your CentOS version. Also, your kernel must be 3.10 at minimum, which CentOS 7 runs.

こっちにも詳しく書いてあった。

Docker v1.8 から RHEL/CentOS6 はサポート外になった - CUBE SUGAR CONTAINER

念のためCentOSのバージョン確認

$ cat /etc/redhat-release
CentOS release 6.7 (Final)

公式のインストール方法をちょこっとだけ修正して、yumリポジトリをcentos/6にセット

$ sudo yum update

$ cat > docker.repo <<-EOF
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/6
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

$ sudo mv docker.repo /etc/yum.repos.d/

あとは普通にyum installするだけ

$ sudo yum install -y docker-engine

$ docker -v
Docker version 1.7.1, build 786b29d

必要ならdaemon登録

$ sudo chkconfig docker on

とりあえずdocker起動

$ sudo service docker start

これで毎回sudoつければdockerコマンドが使えるけど、公式に書いてあるとおりdockerグループを作ってユーザーを追加する

$ docker ps
Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

# sudoつけると大丈夫
$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

# dockerグループにユーザーを追加する
$ sudo usermod -aG docker ユーザー名

# ログアウトして再度ログイン

# sudoいらなくなった
$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

ちゃんと動くか確認

$ docker run --rm centos echo 'hello world'
~~ 省略 ~~
hello world

参考資料

gillax
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした