Created by @oBlank Website : http://www.oBlank.com
Based on docker-php56-fpm-nginx, Docker-Centos-Nginx-PHP and ruby と mongodb, mysql, redis, memcached を入れた docker イメージを作ったメモ
An automated build docker image for this dockerfile is exist in docker hub. go to docker hub
pull command:
docker pull oblank/docker-centos-nginx-php-mongo-redis-memcached
and then you can go straight to Step 4
.
Command:
git clone https://github.com/oblank/Docker-Centos-Nginx-PHP-Mongo-Redis-Memcached.git
Command:
cd Docker-Centos-Nginx-PHP-Mongo-Redis-Memcached
Command:
sudo docker build -t ##NAME_OF_YOUR_DOCKER_IMAGE## .
Note :
a). This command will be fired where the DockerFile will be placed
b). ##NAME_OF_YOUR_DOCKER_IMAGE## : Replace it with your image name
c). . : (.) Symbols shows that your Dockerfile is available on the same directory where you are running the command.
Command Syntax:
sudo docker run --name [container name] -p [port to access (New Port):port exposed(original port)] -i -t [image name]
Command:
sudo docker run --name ##NAME_OF_YOUR_DOCKER_CONTAINER## -d -p 8082:80 ##NAME_OF_YOUR_DOCKER_IMAGE##
Command:
http://127.0.0.1:8082/
- docker images : To list all the images of your docker
- docker ps : To list all the runing containers
- docker kill ####CONTAINER_NAME#### : To kill the runing container
- docker rm ####CONTAINER_NAME#### : To delete the container from the system.
- docker inspect ####CONTAINER_NAME#### : To get all the information about the container.
- docker logs ####CONTAINER_NAME#### : To get the logs of the container.
- docker ps -a: To get the listing of all the containers.
Command for attaching the volume of your hosted machine:
Command Syntax:
sudo docker run --name ##NAME_OF_YOUR_DOCKER_CONTAINER## -d -p 8082:80 -v ##HOSTED_VOLUME_LOCATION##:##CONTAINER_VOLUME_LOCATION## ##YOUR_IMAGE_NAME##
Command Example:
sudo docker run --name apache_ins -d -p 8082:80 -v /var/www/kaushal:/data kaushal_nginx
Important! docker rm ##CONTAINER_NAME##
will delete container without volume, unless you use docker rm -v ##CONTAINER_NAME##
instead.