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