`
sillycat
  • 浏览: 2551285 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Play Raspberry Pi Nginx Docker

 
阅读更多
Play Raspberry Pi Nginx Docker

The project will be named as raspberrypi-nginx

normal Makefile as follow
IMAGE=sillycat/public
TAG=raspberrypi-nginx
NAME=raspberrypi-nginx

prepare:
wget http://nginx.org/download/nginx-1.11.6.tar.gz -P install/

docker-context:

build: docker-context
docker build -t $(IMAGE):$(TAG) .

run:
docker run -d -p 80:80 -v /opt/disk1/nas_cloud/sillycat/person:/data/sillycat -v /opt/disk1/nas_cloud/sillycat/share:/data/share --name $(NAME) $(IMAGE):$(TAG)

debug:
docker run -ti -p 80:80 -v /opt/disk1/nas_cloud/sillycat/person:/data/sillycat -v /opt/disk1/nas_cloud/sillycat/share:/data/share --name $(NAME) $(IMAGE):$(TAG) /bin/bash

clean:
docker stop ${NAME}
docker rm ${NAME}

logs:
docker logs ${NAME}

publish:
docker push ${IMAGE}:${TAG}

fetch:
docker pull ${IMAGE}:${TAG}


The Dockerfile will show how I install the nginx software on ubuntu initial image, I am using 1.11.6 version which is the latest currently.

#Set up nginx in Docker

#Prepre the OS
FROM resin/rpi-raspbian:jessie
MAINTAINER Carl Luo <luohuazju@gmail.com>

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update
RUN apt-get install -y apt-utils
RUN apt-get -y dist-upgrade
RUN apt-get install -y build-essential gcc make
RUN apt-get install -y libpcre3 libpcre3-dev zlib1g-dev libgcrypt11-dev

#install nginx
RUN     mkdir -p /tool
RUN     mkdir -p /install
ADD install/nginx-1.11.6.tar.gz /install/
WORKDIR /install/nginx-1.11.6
RUN ./configure --prefix=/tool/nginx-1.11.6
RUN     make
RUN     make install

#config nginx
ADD     conf/nginx.conf /tool/nginx-1.11.6/conf/

#start the application
EXPOSE  80
RUN     mkdir -p /app/
ADD     start.sh /app/
WORKDIR /app/
CMD [ "./start.sh" ]

The script file start.sh to start the nginx service and keep it running in the back
#!/bin/sh -ex

#start the nginx
cd /tool/nginx-1.11.6
sbin/nginx -g "daemon off;"

Since I do not set up static html/js projects yet, so I just run this nginx project alone with default conf/nginx.conf

>make prepare
>make build
>make run

Visit the page http://localhost will work.

References:
http://sillycat.iteye.com/blog/2166582
分享到:
评论

相关推荐

    Raspberry Pi 4 Beginner’s Guide.pdf

    介绍Raspberry Pi 4的用户手册,值得一读。 In our opinion, you will certainly adore the Raspberry Pi 4. Ultra-small, affordable, even cheaper than most video games, you can use the Pi to build ...

    docker-rpi-alpine:RaspberryPi的Docker Alpine Linux映像

    docker-rpi-alpine 基于Alpine Linux for RaspberryPi的Docker映像 鲍里斯· Boris HUISGEN) 用法 $ ./autogen.sh $ ./configure $ make build

    Wiley Learning Python with Raspberry Pi 2014

    《Wiley Learning Python with Raspberry Pi 2014》是一本专为初学者设计的教程,旨在引导读者通过树莓派这一小型计算机平台学习Python编程。这本书由2014年出版,当时Python已是编程界的热门语言,而树莓派因其低...

    Raspberry Pi Zero Cookbook

    Raspberry Pi Zero Cookbook by Edward Snajder English | 24 Mar. 2017 | ASIN: B01E7GP8GS | 422 Pages | AZW3 | 14.97 MB Key Features Deep dive into the components of the small yet powerful Raspberry Pi...

    Raspberry Pi快速入门指南-奥松

    《Raspberry Pi快速入门指南》是一本面向初学者的实用手册,由Maik Schmidt撰写,国内译者王峰、王江伟、王汝波共同翻译。该书为读者详细介绍了Raspberry Pi这一款迷你Linux计算机的使用方法,并指导用户如何通过...

    Raspberry Pi LED Blueprints(PACKT,2015)

    By customizing and utilising LED-based modules into the Raspberry Pi board, exciting projects can be obtained. A countdown timer, a digital clock, a traffic light controller, and a remote light ...

    Getting Started with Raspberry Pi Zero.pdf

    Raspberry Pi Zero is half the size of Raspberry Pi A, only with twice the utility. At just three centimeters wide, it packs in every utility required for full-fledged computing tasks. This practical ...

    Raspberry Pi Cookbook.pdf

    The world of Raspberry Pi is evolving quickly, with many new interface boards and software libraries becoming available all the time. In this cookbook, prolific hacker and author Simon Monk provides ...

    linux-为RaspberryPi3B构建ChromiumOS

    在Linux世界中,Raspberry Pi是一款非常受欢迎的微型计算机,常用于各种DIY项目和教育用途。Chromium OS,作为Google Chrome OS的基础源代码,是一个轻量级的操作系统,主要设计用于快速启动和运行网络应用。本文将...

    pi-adsb-docker:使用Raspberry Pi和Docker的完整ADS-B接收器和馈送器-支持

    使用Docker与Raspberry Pi和USB电视棒一起跟踪飞机的另一种方法。 与其在单个环境中手动安装所有内容,我们将为每个feeder实例使用单独的docker容器。 受到以下人士的出色工作的启发: 亚历克斯·埃利斯(Alex ...

    Raspberry Pi 3B+ bootloader更新文件

    本次提供的压缩包“pi-bootloader”包含了Raspberry Pi 3B+的重要组成部分——GPU固件和引导加载程序(bootloader)的更新文件。这些文件对于理解和优化Raspberry Pi的启动过程以及系统性能至关重要。 首先,我们要...

    Raspberry.Pi.Home.Automation.with.Arduino.2nd.Edition.178439

    Revolutionize the way you automate your home by combining the power of the Raspberry Pi and Arduino Build simple yet awesome home automated projects using an Arduino and the Raspberry Pi Learn how to ...

    Raspberry Pi User Guide-Halfacree-Gareth

    《Raspberry Pi 用户指南》由 Gareth Halfacree 编写,是 Raspberry Pi 开发者和爱好者的宝贵资源。本文将深入解析此书的关键知识点,帮助读者更好地理解和掌握 Raspberry Pi 的功能与应用。 ### 一、Raspberry Pi ...

    Raspberry Pi

    CHAPTER 1: INTRODUCTION TO RASPBERRY PI THE EVOLUTION OF RASPBERRY PI 2 THE UNIQUE FEATURES: MODEL A MODEL A+ MODEL B MODEL B+ SHOULD YOU BUY THE LATEST RASPBERRY PI 2, IF YOU HAVE PREVIOUS MODELS? ...

    Raspberry.Pi.Computer.Architecture.Essentials.17843

    Explore Raspberry Pi 2's hardware through the Assembly, C/C++, and Python programming languages Experiment with connecting electronics up to your Raspberry Pi 2 and interacting with them through ...

    在Raspberry Pi上搭建ARM Cortex-M3开发环境

    在Raspberry Pi上搭建ARM Cortex-M3开发环境是一项有趣且实用的任务,这使得开发者能够利用Raspberry Pi的强大计算能力来开发基于STM32微控制器的项目。STM32是一款广泛使用的基于ARM Cortex-M3内核的微控制器,适用...

    Raspberry Pi用户指南

    ### Raspberry Pi 用户指南知识点概述 #### 一、Raspberry Pi简介 Raspberry Pi是一款小巧而功能强大的单板计算机,自2012年推出以来,因其价格低廉、配置灵活、应用广泛等特点,受到了全球电子爱好者、教育工作者...

Global site tag (gtag.js) - Google Analytics