Docker Practice Static Web

Docker Practice Static Web

  1. Create Directory Include

    • Dockerfile

    • Nginx File

  2. Edit Dockerfile

    • docker build -t static .

      FROM ubuntu:16.04
      MAINTAINER Robin "xlcoder166@gmail.com"
      RUN apt-get -y update && apt-get -y install nginx
      RUN mkdir -p /var/www/html/website
      ADD nginx/nginx.conf /etc/nginx/nginx.conf
      ADD nginx/default /etc/nginx/sites-available/
      EXPOSE 80
  3. Edit Nginx File

    • daemon off

  4. enable docker

    • docker run -d -p 80 -v /var/www/website:/var/www/html/website static nginx

标签: none

添加新评论