Docker frequently used commands for continuous sorting

Source: Internet
Author: User
Tags docker ps

Download lamp Image: Docker Pull/tutum/lamp
Start Lamp container
Docker run-d-P 8080:80-p 3306:3306 tutum/lamp #启动应用并映射 8080-port and 3306-port
View Docker containers: Docker PS
To stop a container:

./docker.sh Stop Goofy_galileo (container name)
Docker stop Kickass_lalande (container name)


The Docker images command displays all the resources that exist on this computer
Cat/var/lib/docker/repositories-devicemapper | Python-mjson.tool where local resources are saved
Docker build-t scooby_snacks. (This command will be in the location we specify (in the example is the current folder, i.e. ".") ) Look for the Dockerfile file and mirror the compilation based on this. The scooby_snacks here is the name of the warehouse. )
Docker Search Scooby_snacks
Docker Run-i-T Scooby_snacks/bin/bash running a new image file
Docker build-t Sandy/scooby_snacks. Build image Specify user properties
Docker push Sandy/scooby_snacks Docker does not allow us to publish images directly under the root repository (root repository)
Docker RMI Scooby_snacks (warehouse name) Remove Mirror


How to access the Docker container
In order to connect to a container, you need to find the PID of the first process of the container.
Docker Inspect--format "{{. State.pid}} "<container-id>
such as: Docker inspect--format "{{. State.pid}} "0e416b3372dd
With this PID, you can connect to this container:
Nsenter--target $PID--mount--uts--ipc--net--pid
such as: Nsenter--target 19430--mount--uts--ipc--net--pid
RPM-QL Docker-io


This article is from the "My Operations Blog" blog, be sure to keep this source http://linuxpython.blog.51cto.com/10015972/1643728

Docker frequently used commands for continuous sorting

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.