We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd17593 commit 25a4dcbCopy full SHA for 25a4dcb
Dockerfile.heredoc
@@ -0,0 +1,28 @@
1
+# syntax = docker/dockerfile:1.4
2
+
3
+ARG PYTHON_VERSION=3.10.9
4
5
+FROM python:${PYTHON_VERSION}-slim-bullseye
6
7
+ENV USER_NAME=${USER_NAME:-appuser}
8
9
+# TODO: debug `<<-` heredoc operator
10
+RUN <<EOF
11
+#!/usr/bin/env python
12
+import os
13
14
+user_name = os.getenv("USER_NAME", "")
15
16
+try:
17
+ if user_name != "":
18
+ print(f"Hello {user_name}!")
19
+ else:
20
+ print("Hello world!")
21
+except NameError as e:
22
+ pass
23
+finally:
24
+ print("Nice to meet you!")
25
26
+EOF
27
28
+# ENTRYPOINT [ "/bin/bash" ]
0 commit comments