Skip to content

Commit

Permalink
Final slides
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Mar 31, 2022
1 parent 6884fb6 commit a2eef3a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 010_basics/02_volumes/permissions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Permissions
<!-- .slide: id="volume_permissions" -->

XXX Root-owned files
The nuisance of root-owned files

Creating files in user-owned directories can be removed:

Expand Down
2 changes: 2 additions & 0 deletions 020_advanced/150_entrypoint/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
FROM nginx:stable
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions 020_advanced/150_entrypoint/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
set -o errexit

if test -n "${WELCOME_TO_TEXT}"; then
echo "Setting welcome text to <${WELCOME_TO_TEXT}>"
sed -i "s|<h1>Welcome to nginx\!</h1>|<h1>Welcome to ${WELCOME_TO_TEXT}\!</h1>|" /usr/share/nginx/html/index.html
fi

echo "Calling upstream entrypoint"
exec /docker-entrypoint.sh nginx -g "daemon off;"
19 changes: 18 additions & 1 deletion 020_advanced/150_entrypoint/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,21 @@ $ docker run -it --rm entrypoint

## My first entrypoint

XXX
Add an entrypoint to change the behaviour

Example: Change text in web page

```bash
docker build \
--tag my-nginx \
.
docker run --detach \
--publish 127.0.0.1:80:80 \
--env WELCOME_TO_TEXT="Haufe X360" \
my-nginx
curl localhost
```

### More use cases

Change configuration of nginx in `/etc/nginx`

0 comments on commit a2eef3a

Please sign in to comment.