无法直接查看Docker镜像的Dockefile,但是可以利用 docker history命令:
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@iZj6c9wo7lpk4csgnvjsbzZ ~]# docker history --help Usage: docker history [OPTIONS] IMAGE Show the history of an image Options: --help Print usage -H, --human Print sizes and dates in human readable format (default true) --no-trunc Don't truncate output -q, --quiet Only show numeric IDs [root@iZj6c9wo7lpk4csgnvjsbzZ ~]# |
例如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[root@iZj6c9wo7lpk4csgnvjsbzZ ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d75bf414d31c filesysorg/jfileserver "/jfileserver/runs..." 3 minutes ago Up 3 minutes 21/tcp, 139/tcp, 445/tcp, 137-138/udp pensive_bell [root@iZj6c9wo7lpk4csgnvjsbzZ ~]# docker history filesysorg/jfileserver IMAGE CREATED CREATED BY SIZE COMMENT c53ea72b6bad 8 months ago /bin/sh -c #(nop) ENTRYPOINT ["/jfileserv... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_DEBUG_LOGPATH... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_DEBUG_OUTPUT=... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_NORMAL_PASSWO... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_NORMAL_USER=user 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_ADMIN_PASSWOR... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_ADMIN_USER=admin 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SHARE_COMMENT... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SHARE_NAME=jf... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_NFS_DEBUGFLAG... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_FTP_DEBUGFLAG... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_FTP_PORT=21 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SMB_DEBUGFLAG... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SMB_DIALECTS=... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SMB_DOMAIN=do... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SMB_SERVERNAM... 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_NFS_ENABLE=false 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_FTP_ENABLE=false 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_SMB_ENABLE=true 0 B <missing> 8 months ago /bin/sh -c #(nop) EXPOSE 21/tcp 0 B <missing> 8 months ago /bin/sh -c #(nop) EXPOSE 137/udp 0 B <missing> 8 months ago /bin/sh -c #(nop) EXPOSE 138/udp 0 B <missing> 8 months ago /bin/sh -c #(nop) EXPOSE 139/tcp 0 B <missing> 8 months ago /bin/sh -c #(nop) EXPOSE 445/tcp 0 B <missing> 8 months ago /bin/sh -c mkdir logs 0 B <missing> 8 months ago /bin/sh -c chmod +x /jfileserver/runsrv.sh 163 B <missing> 8 months ago /bin/sh -c #(nop) COPY dir:537276cdaeef9e9... 20.3 MB <missing> 2 years ago /bin/sh -c #(nop) WORKDIR /jfileserver 0 B <missing> 2 years ago /bin/sh -c #(nop) LABEL maintainer=gk.spe... 0 B <missing> 2 years ago /bin/sh -c #(nop) LABEL description=Java ... 0 B <missing> 2 years ago /bin/sh -c /var/lib/dpkg/info/ca-certifica... 355 kB <missing> 2 years ago /bin/sh -c set -ex; if [ ! -d /usr/share... 348 MB <missing> 2 years ago /bin/sh -c #(nop) ENV CA_CERTIFICATES_JAV... 0 B <missing> 2 years ago /bin/sh -c #(nop) ENV JAVA_DEBIAN_VERSION... 0 B <missing> 2 years ago /bin/sh -c #(nop) ENV JAVA_VERSION=8u181 0 B <missing> 2 years ago /bin/sh -c #(nop) ENV JAVA_HOME=/docker-j... 0 B <missing> 2 years ago /bin/sh -c ln -svT "/usr/lib/jvm/java-8-op... 33 B <missing> 2 years ago /bin/sh -c { echo '#!/bin/sh'; echo 's... 87 B <missing> 2 years ago /bin/sh -c #(nop) ENV LANG=C.UTF-8 0 B <missing> 2 years ago /bin/sh -c apt-get update && apt-get insta... 2.21 MB <missing> 2 years ago /bin/sh -c apt-get update && apt-get insta... 142 MB <missing> 2 years ago /bin/sh -c set -ex; if ! command -v gpg >... 7.81 MB <missing> 2 years ago /bin/sh -c apt-get update && apt-get insta... 23.2 MB <missing> 2 years ago /bin/sh -c #(nop) CMD ["bash"] 0 B <missing> 2 years ago /bin/sh -c #(nop) ADD file:a61c14b18252183... 101 MB |
如果看不全的话可以加一个 --no-trunc参数(注意,输入的是镜像的名字而不是容器ID):
1 2 3 4 5 6 |
[root@iZj6c9wo7lpk4csgnvjsbzZ ~]# docker history --no-trunc filesysorg/jfileserver IMAGE CREATED CREATED BY SIZE COMMENT sha256:c53ea72b6badb601f1e50457c83bfddbb68d079000e62400cc29b48cdf9a40fd 8 months ago /bin/sh -c #(nop) ENTRYPOINT ["/jfileserver/runsrv.sh"] 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_DEBUG_LOGPATH=/jfileserver/logs/jfileserver.log 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_DEBUG_OUTPUT=File 0 B <missing> 8 months ago /bin/sh -c #(nop) ENV JFSRV_NORMAL_PASSWORD=java |
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » 查看Docker镜像Dockefile