2014年12月20日 星期六

use cdrom in docker container.



  1. make sure you never mount your cdrom.
  2. run you container using the command like ``` docker run -i -t -v /dev/cdrom:/dev/cdrom dockerfiles/centos-lamp /bin/bash```
  3. type ```mkdir /mnt/cdrom``` in your container bash.
  4. type ```mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom``` in your container bash.
  5. see you cdrom using ```ls /mnt/cdrom``` in your container bash.

2014年12月9日 星期二

read .bashrc via ssh.

如果你透過 ssh 登入 linux 主機,預設是不會讀取 .bashrc 。如果你希望登入 ssh 後,自動 source .bashrc ,你需要加入下面的內容到 .bash_profile

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi


ref:
http://stackoverflow.com/questions/820517/bashrc-at-ssh-login