Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
#9 Correcting extension section inside Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Bleul committed Mar 4, 2017
1 parent 811df56 commit 05bd901
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| Version | Tag | Dockerfile |
|--------------|--------------|------------|
| latest | latest | [Dockerfile](https://github.com/blacklabelops/nginx/blob/master/Dockerfile) |
| 1.10.1-r1 | 1.10.1-r1| [Dockerfile](https://github.com/blacklabelops/nginx/blob/master/Dockerfile) |
| 1.2 | 1.2 | [Dockerfile](https://github.com/blacklabelops/nginx/blob/master/Dockerfile) |

# Features

Expand Down Expand Up @@ -40,8 +40,7 @@ Example:

~~~~
$ docker run -d \
-v your_local_config_file.conf:/some/directory/nginx.conf \
-e "NGINX_CONFIG_FILE=/some/directory/nginx.conf" \
-v your_local_config_file.conf:/etc/nginx/nginx.conf \
-p 80:80 \
--name nginx \
blacklabelops/nginx
Expand Down Expand Up @@ -462,52 +461,44 @@ Build the latest release with docker-compose:
$ docker-compose build
~~~~

# Use Your Own Config File

Just mount or place your file at the position `/home/nginx/config.json`!
# How To Extend This Image

Example:
Minimal working example:

~~~~
$ docker run -d \
-p 80:80 \
--name nginx \
-v config.json:/home/nginx/config.json \
blacklabelops/nginx
~~~~
FROM blacklabelops/nginx
> File config.json is your local configuration file.
RUN echo "Install Your Tools"
# How To Extend This Image
# Optional: Your config file
COPY nginx.conf /etc/nginx/nginx.conf
~~~~

Minimal working example Dockerfile:
Example with custom entrypoint:

~~~~
FROM blacklabelops/nginx
MAINTAINER Your Name <[email protected]>
USER root
RUN echo "Install Your Tools"
USER nginx
# Optional: Your config file
COPY config.json /home/nginx/config.json
COPY nginx.conf /etc/nginx/nginx.conf
# Optional: Your entrypoint:
COPY entrypoint.sh /opt/nginx-scripts/
ENTRYPOINT ["/opt/nginx-scripts/entrypoint.sh"]
CMD ["nginx"]
COPY entrypoint.sh /opt/nginx/
ENTRYPOINT ["/opt/nginx/entrypoint.sh"]
~~~~

Minimal working example entrypoint `entrypoint.sh`:

~~~~
#!/bin/bash -x
#!/bin/bash
# Your code
echo My script code
echo "My script code"
# Then call image entrypoint
exec /opt/nginx-scripts/docker-entrypoint.sh
exec /opt/nginx/docker-entrypoint.sh
~~~~

# Support
Expand Down

0 comments on commit 05bd901

Please sign in to comment.