Docker Learning Notes

Source: Internet
Author: User

1. Query the IP address of a Dockers container.

[[email protected] ~]# Docker inspect--format='{{. Networksettings.ipaddress}}'  3ea2b8c52e72172.17. 0.7

Query Container MAC Address

[[email protected] ~]# Docker inspect--format='{{. Networksettings.macaddress}}'  3ea2b8c52e72: All: AC: xx:

Query the landing environment

[[email protected] ~]# Docker inspect--format='{{. LogPath}}'  3ea2b8c52e72/var/lib/docker/containers/ 3ea2b8c52e727bb6ea39e4e23e4126dd521beae8d1007876c1bb75dbb4c1442d/ 3ea2b8c52e727bb6ea39e4e23e4126dd521beae8d1007876c1bb75dbb4c1442d-json.log

View Port Mappings

[[email protected] ~]# Docker inspect--format='{{(index. Networksettings.ports "5000/UDP") 0). Hostport}}'  92d9e2414ca7

View the records that the container has run on (test is the name of the container)

[[Email protected] ~]# docker logs Test[email protected]:/# ^c[email protected]:exit 

Modify the name of the container (rename), rename the new name of the existing name

[email protected] ~]# Docker rename Testren testred

Bulk Delete stopped containers

RM PS ' exited=0 ' awk ' {print $} ' sed ' /^con/d ' ) 5e5281bcd54da6f67afde310186d7a3724fe

Docker Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.