Options: --config string Location of client config files (default "/root/.docker") -c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem") --tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem") --tlskey string Path to TLS key file (default "/root/.docker/key.pem") --tlsverify Use TLS and verify the remote -v, --version Print version information and quit
Commands: attach Attach local standard input, output, and error streams to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes to files or directories on a container's filesystem events Get real time events from the server exec Run a commandin a running container export Export a container's filesystem as a tar archive history Show the history of an image images List images import Import the contents from a tarball to create a filesystem image info Display system-wide information inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN login Log in to a Docker registry logout Log out from a Docker registry logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container ps List containers pull Pull an image or a repository from a registry push Push an image or a repository to a registry rename Rename a container restart Restart one or more containers rm Remove one or more containers rmi Remove one or more images run Run a command in a new container save Save one or more images to a tar archive (streamed to STDOUT by default) search Search the Docker Hub for images start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
显示docker信息
1 2 3 4 5 6 7
┌──(root💀kali)-[/home/kali/桌面] └─# docker -v Docker version 20.10.5+dfsg1, build 55c4c88
┌──(root💀kali)-[/home/kali/桌面] └─# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
└─# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world b8dfde127a29: Pull complete Digest: sha256:0fe98d7debd9049c50b597ef1f85b7c1e8cc81f59c8d623fcb2250e8bec85b38 Status: Downloaded newer image for hello-world:latest
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
┌──(root💀kali)-[/home/kali/vulhub/struts2/s2-001] └─# docker-compose build Building struts2 Sending build context to Docker daemon 3.697MB Step 1/5 : FROM vulhub/tomcat:8.5 ---> 66ba03f6c1d8 Step 2/5 : LABEL maintainer="phithon <root@leavesongs.com>" ---> Using cache ---> 51ccd85e21c0 Step 3/5 : RUN set -ex && rm -rf /usr/local/tomcat/webapps/* && chmod a+x /usr/local/tomcat/bin/*.sh ---> Using cache ---> 0a903d3b8d2e Step 4/5 : COPY S2-001.war /usr/local/tomcat/webapps/ROOT.war ---> Using cache ---> 46e97211b80a Step 5/5 : EXPOSE 8080 ---> Using cache ---> 4d93a32927c7 Successfully built 4d93a32927c7 Successfully tagged s2-001_struts2:latest ┌──(root💀kali)-[/home/kali/vulhub/struts2/s2-001] └─# docker-compose up -d Creating network "s2-001_default" with the default driver Creating s2-001_struts2_1 ... done
查看docker进程
1 2 3 4 5
┌──(root💀kali)-[/home/kali/vulhub/struts2/s2-001] └─# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d5fb2a7ca4c2 s2-001_struts2 "catalina.sh run" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp s2-001_struts2_1 f4417e29b119 hello-world "/hello" 11 minutes ago Exited (0) 11 minutes ago focused_kapitsa
┌──(root💀kali)-[/home/kali/桌面] └─# docker images REPOSITORY TAG IMAGE ID CREATED SIZE python 3.7-slim-buster 1241d4388782 3 months ago 113MB hello-world latest d1165f221234 8 months ago 13.3kB mariadb 10.4.12 b6184b68d1fd 19 months ago 357MB tutum/lamp latest 3d49e175ec00 5 years ago 427MB
└─# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 941e5ff0bd2f tutum/lamp "/run.sh" 23 seconds ago Up 22 seconds 0.0.0.0:3306->3306/tcp, 0.0.0.0:8080->80/tcp lamp f4417e29b119 hello-world "/hello" 3 months ago Exited (0) 3 months ago focused_kapitsa