Docker Images 內的狀態查看方式

因為愈來愈多的機會會取用到 Docker Hub 上的 images , 所以整理一下可以快速用這個 image 啟動一個 docker container 來看 images 內的系統版本與檔案相關路徑等資訊

  • docker run -i -t <image> <shell cmd> Exp. php image

    docker run -i -t php:7.0.33-cli-jessie bash

  • 查看作業系統版本

    [email protected]:/# cat /etc/issue
    Debian GNU/Linux 8 \n \l

  • 查看 php 版本與路徑

    [email protected]:/# 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
    [email protected]:/# which php
    /usr/local/bin/php
    [email protected]:/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

  • 目前有哪些 php 模組

    [email protected]:/# 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]

  • tech/docker_images.txt
  • 上一次變更: 2021/10/14 14:53
  • jonathan