Skip to content

zazabe/workshop-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Docker Workshop: Basics

Note: install kitematic on mac to have docker running inside a VM.

Images

  • build the image within the image folder docker build -t <tag-name> .

nginx

  • nginx exposed on the port 80.
  • Run /usr/sbin/nginx -c /etc/nginx/nginx.conf as the entrypoint.
  • Virtual host configuration can be mounted into /etc/nginx/conf.d/

php-fpm

  • php-fpm exposed on the port 9000.
  • Run /usr/sbin/php5-fpm --nodaemonize as the entrypoint.

Containers

  • start a container: docker run [-it] [-d] [--rm] [-p <host-port>:<container-port>] [-v <host-volume:container-volume>] [-l <container-name>:<var-name>] --name <container-name> <tag-name> [cmd]
  • run a command on a running container docker exec <container-name> <cmd>
  • start nginx linked with php-fpm with docker-compose (in app folder): docker-compose up nginx-php
  • start nginx linked with php-fpm (in app folder):
docker run -d --name php-fpm -v $(pwd)/html:/var/www/html demo/php-fpm:latest
docker run -d --name nginx-php -v $(pwd)/config:/etc/nginx/conf.d -p 80:80 --link php-fpm:php  demo/nginx:latest

About

Basics things about docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published