No Description

Frederic G. MARAND 43bf980d17 First commit: basic intro, create a custom Nginx images using a Dockerfile. 6 years ago
nginx 43bf980d17 First commit: basic intro, create a custom Nginx images using a Dockerfile. 6 years ago
Dockerfile 43bf980d17 First commit: basic intro, create a custom Nginx images using a Dockerfile. 6 years ago
README.md 43bf980d17 First commit: basic intro, create a custom Nginx images using a Dockerfile. 6 years ago

README.md

From https://www.codeschool.com/screencasts/build-a-node-app-with-postgres-and-docker

  • Run nginx

    • in foreground
    • docker run -p 81:80 --name web nginx
    • in foreground and removing it when stopped
    • docker run -p 81:80 --name web --rm nginx
    • in background
    • docker run -p 81:80 --name web -d nginx
    • foreground, mounting the nginx/html directory:

      docker run --rm \ -p 81:80 \ --name web \ --mount type=bind,source=$PWD/nginx/html,target=/usr/share/nginx/html \ nginx

  • Enter the container:

    docker exec -it web /bin/bash

  • Build a local image from the Dockerfile

    docker build -t osinet/nginx:latest .

  • Run the newly built image:

    docker run --rm

    -p 81:80 \
    --name web \
    --mount type=bind,source=$PWD/nginx/html,target=/usr/share/nginx/html \ 
    osinet/nginx
    
  • List images

    • All except intermediates: docker images
    • All including intermediates: docker images -a
    • Images with this name: docker images osinet/nginx