LoginSignup
30
33

More than 5 years have passed since last update.

dockerのCentOS公式イメージ

Posted at

ちょっと気がついたので、メモ。
https://registry.hub.docker.com のCentOS公式イメージですが、何の気無しにdocker pull すると、すでにCentOS7を引っ張ってくるようになっています。

デフォルトでlatestなイメージを使うため。

なので、CentOS6を使いたい場合は、自分の環境で取り込む際に、イメージ+タグで指定すること。

# centos:centos6 とタグ付きで指定 
$ docker run -it centos:centos6 cat /etc/redhat-release
CentOS release 6.5 (Final)

# 何も指定しないとlatest
$ docker run -it centos cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core) 

$ docker images
REPOSITORY         TAG            IMAGE ID       CREATED             VIRTUAL SIZE
centos             latest         1a7dc42f78ba   4 days ago          236.4 MB
centos             centos6        cd934e0010d5   5 days ago          206.9 MB

30
33
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
30
33