@@ -28,13 +28,15 @@ modified, and then executes a wrapped executable.
2828
2929Save the following to ` Dockerfile ` :
3030
31- ```
31+ ``` dockerfile
3232FROM python:3
3333
34- RUN apt-get update; apt-get install -y jq
34+ RUN apt-get update; apt-get install -y jq curl
3535
3636# Download the latest version of udl
37- RUN curl -s https://api.github.com/repos/mcasperson/UltimateDockerLauncher/releases/latest | jq '.assets[] | select(.name|match("udl$")) | .browser_download_url' | xargs -I {} curl -L -o /opt/udl {}
37+ RUN curl -s https://api.github.com/repos/mcasperson/UltimateDockerLauncher/releases/latest | \
38+ jq '.assets[] | select(.name|match("udl$")) | .browser_download_url' | \
39+ xargs -I {} curl -L -o /opt/udl {}
3840RUN chmod +x /opt/udl
3941
4042# UDL_WRITEFILE[filename] environment variables are used to save files
@@ -52,6 +54,29 @@ print(f.read())' >> /app/main.py
5254CMD [ "/opt/udl" , "python" , "/app/main.py" ]
5355```
5456
57+ Here is another example Dockerfile using UDL with Apache, this time using bash to execute UDL before the main app:
58+
59+ ``` dockerfile
60+ FROM httpd:2.4
61+
62+ RUN apt-get update; apt-get install -y jq curl
63+
64+ # Download the latest version of udl
65+ RUN curl -s https://api.github.com/repos/mcasperson/UltimateDockerLauncher/releases/latest | \
66+ jq '.assets[] | select(.name|match("udl$")) | .browser_download_url' | \
67+ xargs -I {} curl -L -o /opt/udl {}
68+ RUN chmod +x /opt/udl
69+
70+ # UDL_WRITEFILE[filename] environment variables are used to save files
71+ ENV UDL_WRITEFILE[/usr/local/apache2/htdocs/config.json]='{"whatever": ["hello"]}'
72+
73+ # UDL_SETVALUE[file][key] environment variables are used to set values inside configuration files like JSON, YAML, INI etc
74+ ENV UDL_SETVALUE[/usr/local/apache2/htdocs/config.json][whatever:0]="world"
75+
76+ # Here we use bash to call UDL before calling the main application
77+ CMD [ "/bin/bash" , "-c" , "/opt/udl; httpd-foreground" ]
78+ ```
79+
5580Build the image with:
5681
5782``` bash
0 commit comments