2018年3月19日 星期一

Docker command

Docker 是在本機OS上執行虛擬化,與傳統的虛擬方法不太一樣。
以下是Docker的常用指令

docker images //show local docker images
docker search python //search docker images online
docker pull python // pull store images to local
docker run -t -i python /bin/bash  //run docker images(name:python) by bash
-i : Keep STDIN open even if not attached ,無論有無 Attach ,都會確保 STDIN 有持續開啟
-t : Allocate a pseudo-tty 分配一個 tty
docker commit -m "Add pandas" -a "add pandas" f446ce29c915 python
-m : same like git
-a : 指定更新的使用者信息
(一堆數字) 建立映像檔的容器的 ID
(string) images and tag
docker save -o python3.tar python //save imaes to tar file
docker rmi centos/python-35-centos7   //delete local docker images
sudo docker load < ubuntu_14.04.tar //load tar to local docker

如果要在VM裡的OS測試Docker,則該VM必須要設定 ParavirtualizationInterface 為 Hyper-V

Centos GUI Webserver 設定

新灌的一台Centos7可以做以下的設定 語系設定: - sudo localectl set-locale LC_CTYPE=zh_TW.UTF-8 修改ssh port - http://linux.vbird.org/linux_server/0310telne...