forked from osixia/container-baseimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e893b4
commit 65777ce
Showing
10 changed files
with
153 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
# Use single process image example | ||
FROM example/single-process | ||
# Use osixia/light-baseimage | ||
# https://github.com/osixia/docker-light-baseimage | ||
FROM osixia/light-baseimage:0.2.1-dev | ||
MAINTAINER Your Name <[email protected]> | ||
|
||
# Install multiple process stack and download php5-fpm | ||
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service-available | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/.cfssl/install.sh | ||
# add non free repository to apt-get install multiple process stack, nginx and php5-fpm | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-multiple-process-stack | ||
RUN echo "deb http://http.debian.net/debian/ jessie main contrib non-free" >> /etc/apt/sources.list \ | ||
&& apt-get -y update \ | ||
&& /container/tool/install-multiple-process-stack \ | ||
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
nginx \ | ||
php5-fpm | ||
|
||
# Add service directory to /container/service | ||
# Content : | ||
# /container/service/nginx (from example/single-process) | ||
# /container/service/php5-fpm | ||
ADD service /container/service | ||
|
||
# Use baseimage install-service script and clean all | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service | ||
RUN /container/tool/install-service \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Add default env directory | ||
ADD environment /container/environment/99-default | ||
|
||
# Set /var/www/ in a data volume | ||
VOLUME /var/www/ | ||
|
||
# Expose default http and https ports | ||
EXPOSE 80 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This is the default image configuration file | ||
# These values will persists in container environment. | ||
|
||
# All environment variables used after the container first start | ||
# must be defined here. | ||
# more information : https://github.com/osixia/docker-light-baseimage | ||
|
||
WHO_AM_I: We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us. |
9 changes: 9 additions & 0 deletions
9
example/multiple-process-image/environment/default.yaml.startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This is the default image startup configuration file | ||
# this file define environment variables used during the container **first start** in **startup files**. | ||
|
||
# This file is deleted right after startup files are processed for the first time, | ||
# after that all these values will not be available in the container environment. | ||
# This helps to keep your container configuration secret. | ||
# more information : https://github.com/osixia/docker-light-baseimage | ||
|
||
FIRST_START_SETUP_ONLY_SECRET: The bdd password is Baw0unga! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -e | ||
# this script is run during the image build | ||
|
||
rm -rf /var/www/html/index.nginx-debian.html | ||
echo "Hi!" > /var/www/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
echo "The secret is: $FIRST_START_SETUP_ONLY_SECRET" | ||
exec /usr/sbin/nginx -g "daemon off;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash -e | ||
FIRST_START_DONE="${CONTAINER_STATE_DIR}/nginx-first-start-done" | ||
|
||
# container first start | ||
if [ ! -e "$FIRST_START_DONE" ]; then | ||
echo ${WHO_AM_I} >> /var/www/html/index.html | ||
touch $FIRST_START_DONE | ||
fi | ||
|
||
echo "The secret is: $FIRST_START_SETUP_ONLY_SECRET" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
# Use osixia/light-baseimage | ||
# sources: https://github.com/osixia/docker-light-baseimage | ||
# https://github.com/osixia/docker-light-baseimage | ||
FROM osixia/light-baseimage:0.2.1-dev | ||
MAINTAINER Your Name <[email protected]> | ||
|
||
# Download nginx and install cfssl from baseimage | ||
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service-available | ||
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/.cfssl/install.sh | ||
# Install nginx | ||
RUN apt-get -y update \ | ||
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
nginx | ||
|