它适用于 ubuntu 图像
wolf@linux:~$ docker run -it ubuntu /bin/bash
root@00e6296d31d8:/#
但是,当我尝试使用不同的图像(例如 )时vulnerables/web-dvwa
,它不再起作用
wolf@linux:~$ docker run -it vulnerables/web-dvwa /bin/bash
[+] Starting mysql...
[ ok ] Starting MariaDB database server: mysqld.
[+] Starting apache
[....] Starting Apache httpd web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
. ok
==> /var/log/apache2/access.log <==
==> /var/log/apache2/error.log <==
[Sat Apr 03 11:54:24.321232 2021] [mpm_prefork:notice] [pid 307] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Apr 03 11:54:24.321280 2021] [core:notice] [pid 307] AH00094: Command line: '/usr/sbin/apache2'
==> /var/log/apache2/other_vhosts_access.log <==
id
whoami
此容器中没有 bash shell
wolf@linux:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
820d3a292b2c vulnerables/web-dvwa "/main.sh /bin/bash" 11 seconds ago Up 11 seconds 80/tcp upbeat_visvesvaraya
wolf@linux:~$