Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ LABEL \
summary="Sample app running on Open Liberty that uses Eclipse MicroProfile" \
description="This image contains a sample application that displays the Java system properties and demonstrates MicroProfile Config, Health and Metrics."

USER 0
RUN command -v yum && pkgcmd=yum || pkgcmd=microdnf && $pkgcmd update -y && $pkgcmd install -y procps-ng net-tools ncurses hostname
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: use parentheses to separate the conditions, so it's clear / no ambiguity in the evaluation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$pkgcmd will lose scope once parenthesized, however the && and || have equal precedence and will be evaluated from left to right. For better readability, I parenthesized the update/install command at the end.

USER 1001

COPY --chown=1001:0 src/main/liberty/config/ /config/

RUN features.sh
Expand Down
Loading