Skip to content

Commit

Permalink
fix: Fix broken Containerfile
Browse files Browse the repository at this point in the history
It turns out the prior version of the `Containerfile` was broken,
as the install script for Hipcheck wouldn't actually work due to a
missing `xz-utils` package. This was obscured by my own networking
issues, causing me to inadequately test the prior change.

One other change this makes is that it splits the `RUN` commands
up with a `USER` command, so the first `RUN` is done as root to set
up the system, and the second `RUN` is done as `hc_user` to install
Hipcheck.

Signed-off-by: Andrew Lilley Brinker <[email protected]>
  • Loading branch information
alilleybrinker authored and j-lanson committed Sep 20, 2024
1 parent 22fb550 commit 36a18a6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions dist/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ WORKDIR /app

RUN set -eux \
&& apt-get update \
&& apt-get install -y git curl \
&& apt-get install --no-install-recommends -y git curl xz-utils \
&& rm -rf /var/lib/apt/lists/* \
&& adduser --disabled-password hc_user \
&& chown -R hc_user /app \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitre/hipcheck/releases/download/hipcheck-v${HC_VERSION}/hipcheck-installer.sh | sh
&& chown -R hc_user /app

USER hc_user
COPY config/ config/
ENV HC_CONFIG=./config
ENTRYPOINT ["./hc"]
CMD ["help"]

RUN set -eux \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitre/hipcheck/releases/download/hipcheck-v${HC_VERSION}/hipcheck-installer.sh | sh \
&& $HOME/.cargo/bin/hc setup

ENV HC_CONFIG="$HOME/.config/hipcheck"
ENTRYPOINT "$HOME/.cargo/bin/hc"
CMD "help"

0 comments on commit 36a18a6

Please sign in to comment.