How to check the path of the mapped docker container

angryTom
Release: 2020-03-16 18:12:23
Original
12068 people have browsed it

How to check the path of the mapped docker container

How to check the path of the mapped docker container

Use the following command. container_name is the name of the container, you can also write the ID of the container.

$ docker inspect container_name | grep Mounts -A 20
Copy after login

Output example:

"Mounts": [
  {
      "Type": "bind",
      "Source": "/usr/bin/docker",
      "Destination": "/usr/bin/docker",
      "Mode": "",
      "RW": true,
      "Propagation": "rprivate"
  },
  {
      "Type": "bind",
      "Source": "/usr/lib64/libltdl.so.7",
      "Destination": "/usr/lib/x86_64-linux-gnu/libltdl.so.7",
      "Mode": "",
      "RW": true,
      "Propagation": "rprivate"
  },
  {
      "Type": "bind",
      "Source": "/var/jenkins_home",
      "Destination": "/var/jenkins_home",
Copy after login

Note: You can use the docker ps -a command to obtain the container ID

Output example:

CONTAINER ID   IMAGE          COMMAND                ...  PORTS                    NAMES
09b93464c2f7   nginx:latest   "nginx -g 'daemon off" ...  80/tcp, 443/tcp          myrunoob
96f7f14e99ab   mysql:5.6      "docker-entrypoint.sh" ...  0.0.0.0:3306->3306/tcp   mymysql
Copy after login

More related tutorials, Please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to check the path of the mapped docker container. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!