You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/build/secrets/platforms-buildrunner.yaml
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,18 @@ steps:
8
8
simple-build-step:
9
9
build:
10
10
dockerfile: |
11
-
FROM alpine:latest
11
+
FROM busybox:latest
12
12
# Using secrets inline (commented out since it fails in github actions)
13
13
# RUN --mount=type=secret,id=secret1 \
14
14
# --mount=type=secret,id=secret2 \
15
15
# echo Using secrets in my build - secret1 file located at /run/secrets/secret1 with contents $(cat /run/secrets/secret1) and secret2=$(cat /run/secrets/secret2)
16
-
# Using secrets in environment variables
17
16
RUN --mount=type=secret,id=secret1 \
18
-
--mount=type=secret,id=secret2 \
19
-
SECRET1_FILE=/run/secrets/secret1 \
20
-
SECRET2_VARIABLE=$(cat /run/secrets/secret2) \
21
-
&& echo Using secrets in my build - secret1 file located at $SECRET1_FILE with contents $(cat $SECRET1_FILE) and secret2=$SECRET2_VARIABLE
17
+
--mount=type=secret,id=secret2 \
18
+
sh -c ' \
19
+
SECRET1_FILE=/run/secrets/secret1; \
20
+
SECRET2_VARIABLE=$(cat /run/secrets/secret2); \
21
+
echo "Using secrets in my build - secret1 file located at $SECRET1_FILE with contents $(cat $SECRET1_FILE) and secret2=$SECRET2_VARIABLE" \
0 commit comments