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的用户手册,值得一读。 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 基于Alpine Linux for RaspberryPi的Docker映像 鲍里斯· Boris HUISGEN) 用法 $ ./autogen.sh $ ./configure $ make build
《Wiley Learning Python with Raspberry Pi 2014》是一本专为初学者设计的教程,旨在引导读者通过树莓派这一小型计算机平台学习Python编程。这本书由2014年出版,当时Python已是编程界的热门语言,而树莓派因其低...
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快速入门指南》是一本面向初学者的实用手册,由Maik Schmidt撰写,国内译者王峰、王江伟、王汝波共同翻译。该书为读者详细介绍了Raspberry Pi这一款迷你Linux计算机的使用方法,并指导用户如何通过...
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 ...
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 ...
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世界中,Raspberry Pi是一款非常受欢迎的微型计算机,常用于各种DIY项目和教育用途。Chromium OS,作为Google Chrome OS的基础源代码,是一个轻量级的操作系统,主要设计用于快速启动和运行网络应用。本文将...
使用Docker与Raspberry Pi和USB电视棒一起跟踪飞机的另一种方法。 与其在单个环境中手动安装所有内容,我们将为每个feeder实例使用单独的docker容器。 受到以下人士的出色工作的启发: 亚历克斯·埃利斯(Alex ...
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 用户指南》由 Gareth Halfacree 编写,是 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? ...
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的强大计算能力来开发基于STM32微控制器的项目。STM32是一款广泛使用的基于ARM Cortex-M3内核的微控制器,适用...
### Raspberry Pi 用户指南知识点概述 #### 一、Raspberry Pi简介 Raspberry Pi是一款小巧而功能强大的单板计算机,自2012年推出以来,因其价格低廉、配置灵活、应用广泛等特点,受到了全球电子爱好者、教育工作者...
RaspberryPi-CPUMiner, CPUMiner RaspberryPi零,Pi 3,Pi 2,B+,+ raspberrypi CPUMiner + CPUMiner,带有新算法( 检查波纹管)CPUMiner RaspberryPi零,Pi 3,引脚 2,B+,A+ 。克隆:池 PiZero指令:下载minerd到...