顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== Docker Images 內的狀態查看方式 ====== 因為愈來愈多的機會會取用到 [[https://hub.docker.com/|Docker Hub]] 上的 images , 所以整理一下可以快速用這個 image 啟動一個 docker container 來看 images 內的系統版本與檔案相關路徑等資訊 ===== 基本語法 ===== * **docker run -i -t <image> <shell cmd>** Exp. php image<cli> docker run -i -t php:7.0.33-cli-jessie bash </cli> * 查看作業系統版本<cli> root@ef8c2a5ab946:/# cat /etc/issue Debian GNU/Linux 8 \n \l </cli> * 查看 php 版本與路徑<cli> root@ef8c2a5ab946:/# php -v PHP 7.0.33 (cli) (built: Dec 29 2018 07:12:20) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies root@ef8c2a5ab946:/# which php /usr/local/bin/php root@ef8c2a5ab946:/usr/local/src# ls -l /usr/local/ total 40 drwxrwsr-x 1 root staff 4096 Dec 29 2018 bin drwxrwsr-x 1 root staff 4096 Dec 29 2018 etc drwxrwsr-x 2 root staff 4096 Dec 26 2018 games drwxrwsr-x 1 root staff 4096 Dec 29 2018 include drwxrwsr-x 1 root staff 4096 Dec 29 2018 lib lrwxrwxrwx 1 root staff 9 Dec 26 2018 man -> share/man drwxr-sr-x 3 root staff 4096 Dec 29 2018 php drwxrwsr-x 2 root staff 4096 Dec 26 2018 sbin drwxrwsr-x 1 root staff 4096 Dec 29 2018 share drwxrwsr-x 2 root staff 4096 Dec 26 2018 src drwxr-sr-x 4 root staff 4096 Dec 29 2018 var </cli> * 目前有哪些 php 模組<cli> root@bd62f18ef84e:/# php -m [PHP Modules] Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules] </cli> ===== 參考網址 ===== * https://ithelp.ithome.com.tw/articles/10186431 * https://kknews.cc/zh-tw/code/rn8bpxr.html {{tag>docker container k8s}} tech/docker_images.txt 上一次變更: 2021/10/14 14:53由 jonathan