Skip to content

Commit 61f4c4a

Browse files
committed
docs: Update welcome message
1 parent 09ab7ad commit 61f4c4a

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

linux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ LABEL org.opencontainers.image.source="https://github.com/fortify/fcli" \
141141
RUN echo "fcli:x:10001:10001:fcli:/data:/sbin/nologin" >> /etc/passwd
142142
COPY --from=fcli-downloader /tmp/fcli-bin/fcli /usr/bin/fcli
143143
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
144-
COPY welcome.txt /usr/share/fcli/welcome.txt
144+
COPY welcome*.txt /usr/share/fcli/
145145
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
146146
ADD data.tgz /
147147
WORKDIR /data
@@ -173,7 +173,7 @@ LABEL org.opencontainers.image.source="https://github.com/fortify/fcli" \
173173
RUN echo "fcli:x:10001:10001:fcli:/data:/sbin/nologin" >> /etc/passwd
174174
COPY --from=fcli-downloader /tmp/fcli-bin/fcli /usr/bin/fcli
175175
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
176-
COPY welcome.txt /usr/share/fcli/welcome.txt
176+
COPY welcome*.txt /usr/share/fcli/
177177
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
178178
ADD data.tgz /
179179
WORKDIR /data

linux/docker-entrypoint.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@
99
if [ -t 0 ] && [ $# -eq 1 ]; then
1010
case "$1" in
1111
/bin/sh|/bin/bash|sh|bash)
12-
# Display welcome message for interactive shell sessions
13-
cat /usr/share/fcli/welcome.txt
12+
# Display base welcome message for interactive shell sessions
13+
# Build an `EXTRA_NOTES` env var and interpolate it into the
14+
# `${EXTRA_NOTES}` placeholder inside `welcome.txt`.
15+
EXTRA_NOTES=""
16+
if [ -d /opt/fortify/sc-client ] && [ -f /usr/share/fcli/welcome-sc-note.txt ]; then
17+
# Prefix a blank line so the note is separated from prior text
18+
EXTRA_NOTES="$(printf '\n%s' "$(cat /usr/share/fcli/welcome-sc-note.txt)")"
19+
fi
20+
21+
# Replace literal `${EXTRA_NOTES}` placeholder with the value of
22+
# the EXTRA_NOTES variable. Using awk preserves newlines.
23+
awk -v extra="$EXTRA_NOTES" '{ gsub(/\$\{EXTRA_NOTES\}/, extra); print }' /usr/share/fcli/welcome.txt
1424
;;
1525
esac
1626
fi

linux/welcome-sc-note.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Note: This image variant also includes ScanCentral Client, which can be
2+
invoked via the `scancentral` command. See `scancentral --help` or
3+
the product documentation for details. Please also see note above
4+
about packaging.

linux/welcome.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@ Note: fcli stores session state and cache in /data (FCLI_USER_HOME).
2323
For persistent state across image invocations, mount a volume:
2424
docker run -v fcli-data:/data ...
2525

26+
Note: This image does not include any build tools, and is therefore not
27+
suitable for for packaging source code through ScanCentral Client
28+
for languages that require build tool integration. If the
29+
`scancentral package` command is being run within this container
30+
(for example through fcli `ci` or `package` actions or direct
31+
ScanCentral Client invocation), the `-bt none` option must be
32+
passed to avoid errors due to missing build tools. Depending on
33+
source code language, using `-bt none` may produce inaccurate
34+
scan results.
35+
${EXTRA_NOTES}
2636
════════════════════════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)