CentOS 6.5にDockerをインストール

CentOS 6.5にDockerをインストール

OSのアップデート

yum -y update

管理用ユーザーを追加

ユーザーを追加

useradd docker

パスワードを設定

passwd docker

ユーザー docker のパスワードを変更。 新しいパスワード: 新しいパスワードを再入力してください: passwd: 全ての認証トークンが正しく更新できました。

ユーザーにsudo権限を追加

visudo

「Allow root to run any commands anywhere」に以下を追加
docker ALL=(ALL) ALL

変更を保存 [ESC]→:wq

Dockerをインストール

dockerユーザーでログイン

$ su docker

Dockerのインストール

$ sudo yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm $ sudo yum -y install docker-io $ sudo service docker start $ sudo chkconfig docker on

一般ユーザーでもdockerを使えるようにする

一般ユーザーで使えるようにする

dockerグループに所属させる方法 man docketの先頭に書いてある 他にも /var/run/docker.sockの権限を変更する方法や /etc/sysconfig/dockerで起動オプションを変更する方法もある これを忘れると /var/run/docker.sock: permission denied

$ sudo usermod -a -G docker docker

VMWareFusion上のCentOS6.5にVMWareToolsをインストール

CentOS6.5にVMWareToolsをインストール

VMWareToolsのインストール

ゲストOSを選択しメニューバーから「仮想マシン」->「VMware Toolsのインストール」をクリックします。 この状態で、マウントされたイメージをコピーしてインストール作業に入ります。

CDマウント用ディレクトリを作成しマウントする

$ mkdir /mnt/cdrom $ mount /dev/cdrom /mnt/cdrom $ mount: ブロックデバイス /dev/sr0 は書き込み禁止です、読込み専用でマウントします

マウントした場所から一時領域にファイルをコピーする。

※Vmwaretooks-xxxxxのバージョン名は利用しているVmwareによって異なります。 $ cp /mnt/cdrom/VMwareTools-9.2.4-1398046.tar.gz /tmp/VMwareTools.tar.gz

コピーし終わったのでアンマウントしておきます。

$ umount /mnt/cdrom/

ファイルをコピーしたディレクトリへ移動しファイルを展開

$ cd /tmp/ $ tar zxvf VMwareTools.tar.gz

展開されたディレクトリへ移動しPerlスクリプトを実行

$ cd vmware-tools-distrib/ $ ./vmware-install.pl

*基本的にEnterを連打で問題無いと思う

Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files? 
[/usr/bin] 

What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc/rc.d] 

What is the directory that contains the init scripts? 
[/etc/rc.d/init.d] 

In which directory do you want to install the daemon files? 
[/usr/sbin] 

In which directory do you want to install the library files? 
[/usr/lib/vmware-tools] 

The path "/usr/lib/vmware-tools" does not exist currently. This program is 
going to create it, including needed parent directories. Is this what you want?
[yes] 

In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools] 

The path "/usr/share/doc/vmware-tools" does not exist currently. This program 
is going to create it, including needed parent directories. Is this what you 
want? [yes] 

The installation of VMware Tools 9.2.4 build-1398046 for Linux completed 
successfully. You can decide to remove this software from your system at any 
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by 
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 
this program to invoke the command for you now? [yes] 

Initializing...


Making sure services for VMware Tools are stopped.



The VMware FileSystem Sync Driver (vmsync) allows external third-party backup 
software that is integrated with vSphere to create backups of the virtual 
machine. Do you wish to enable this feature? [no] 

Found a compatible pre-built module for vmci.  Installing it...


Found a compatible pre-built module for vsock.  Installing it...


The module vmxnet3 has already been installed on this system by another 
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this system by another 
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=pvscsi to override.

The module vmmemctl has already been installed on this system by another 
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=vmmemctl to override.

The VMware Host-Guest Filesystem allows for shared folders between the host OS 
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
to enable this feature? [yes] 

Found a compatible pre-built module for vmhgfs.  Installing it...


Found a compatible pre-built module for vmxnet.  Installing it...


The vmblock enables dragging or copying files between host and guest in a 
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[yes] 

NOTICE:  It appears your system does not have the required fuse packages 
installed.  The VMware blocking filesystem requires the fuse packages and its 
libraries to function properly.  Please install the fuse or fuse-utils package 
using your systems package management utility and re-run this script in order 
to enable the VMware blocking filesystem. 

!!! [EXPERIMENTAL] !!!
VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present.  By selecting yes,
you will be enabling this experimental feature.  You can always disable this
feature by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no] 

No X install found.

Creating a new initrd boot image for the kernel.
vmware-tools-thinprint start/running
vmware-tools start/running
The configuration of VMware Tools 9.2.4 build-1398046 for Linux for this 
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file

Perlのインストール

「/usr/bin/perl: bad interpreter: そのようなファイルやディレクトリはありません」 Perlが無くておこられる場合は、yumでぶっ込む

$ yum install perl

インストール後の確認

VMware Toolsインストールバージョンの確認

$ /usr/bin/vmware-toolbox-cmd -v

9.2.4.27715 (build-1398046)

ステータスの確認

$ status vmware-tools

vmware-tools start/running

問題が無いようであればCentOSを再起動しておきます。

$ reboot

Vmware Toolsが起動しない場合のトラブルシューティング

ステータスの確認

$ status vmware-tools

vmware-tools stop/waiting となっている場合何らかの原因で自動起動していません。

vmware-toolsの手動起動してみる

$ start vmware-tools

start: Job failed to start とでる場合は手動実行も出来ない状態となります。その場合、 コンフィグスクリプトを再度実行 $ /usr/bin/vmware-config-tools.pl