Docker(Docker Engine)
• Define
1. Docker provides a way to run applications securely isolated in a container, packaged with all its dependencies and libraries.
2. Containers are a way to package software in a format that can run isolated on a shared operating system. Unlike VMs, containers do not bundle a full operating system - only libraries and settings required to make the software work are needed
• Structure
the client-server application made up of the Docker daemon, a REST API that specifies interfaces for interacting with the daemon,and a command line interface (CLI) client that talks to the daemon (through the REST API wrapper).
• CLI
○ https://docs.docker.com/engine/reference/run/
○ Sample
§ docker --help
§ docker build -t songgs/apache-php-mysql:20m .
§ docker run -d -p 8080:80 -u 0:0 --name wplocal -v /var/LWASFiles/Sites/new2/home:/home -e PORT="80" appsvc/apps:wordpress
§ docker exec -it containerid bash
§ docker push songgs/apache-php-mysql:20m
§ docker rmi –f $(docker images -q -f dangling=true)
§ docker rm -f $(docker ps -aq -f status=exited)
• Learn : 中文版
Docker Image
- Apache-PHP-MySQL
PHP installed as apache module: http://php.net/manual/en/security.apache.php - Nginx-PHP
- Python
nginx <-> /tmp/uwsgi.sock <-> uWSGI <-> Python app <-> Psycopg2 <-> remote PostgreSQL database