When using the docker container, we always want to see what the container looks like inside: we can use the docker exec command to meet our expectations:
➜ compose docker exec --help Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] Run a command in a running container Options: -d, --detach Detached mode: run command in the background --detach-keys string Override the key sequence for detaching a container -e, --env list Set environment variables -i, --interactive Keep STDIN open even if not attached --privileged Give extended privileges to the command -t, --tty Allocate a pseudo-TTY -u, --user string Username or UID (format: <name|uid>[:<group|gid>]) -w, --workdir string Working directory inside the container
The name of the container added to us is compose web 1. Use the following command:
docker exec -it compose_web_1 /bin/sh
I found that the internal situation is as follows:
/code # cd .. / # ls bin code dev etc home lib media mnt proc root run sbin srv sys tmp usr var / # ls bin/ arch chown dumpkmap fsync ipcalc ls mountpoint pipe_progress run-parts su watch ash conspy echo getopt kbd_mode lzop mpstat printenv sed sync zcat base64 cp ed grep kill makemime mv ps setpriv tar bbconfig date egrep gunzip link mkdir netstat pwd setserial touch busybox dd false gzip linux32 mknod nice reformime sh true cat df fatattr hostname linux64 mktemp pidof rev sleep umount chgrp dmesg fdflush ionice ln more ping rm stat uname chmod dnsdomainname fgrep iostat login mount ping6 rmdir stty usleep
At present, it has entered the internal docker container. This is the file distribution. What is the specific principle? Is it a linux virtual machine? Is it a complete linux kernel? What else? I have some questions in my heart. Let's talk about it in this post! Check the above command, busybox command also aroused my interest? We'll investigate later.
Keep up to date, reprint please indicate the source.