Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Simplify Containerfile #428

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
file: Containerfile
file: dist/Containerfile
push: false
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: Containerfile
file: dist/Containerfile
push: true
platforms: "linux/amd64,linux/arm64"
tags: mitre/hipcheck:latest,mitre/hipcheck:${{ steps.format-tag.outputs.replaced }}
Expand Down
43 changes: 0 additions & 43 deletions Containerfile

This file was deleted.

21 changes: 21 additions & 0 deletions dist/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0

FROM node:bookworm-slim

ARG HC_VERSION="3.6.3"

WORKDIR /app

RUN set -eux \
&& apt-get update \
&& apt-get install -y git curl \
&& 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

USER hc_user
COPY config/ config/
ENV HC_CONFIG=./config
ENTRYPOINT ["./hc"]
CMD ["help"]
2 changes: 1 addition & 1 deletion site/content/install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ download the repository contents from GitHub without the Git history.
```sh
$ git clone https://github.com/mitre/hipcheck
$ cd hipcheck
$ docker build -f Containerfile .
$ docker build -f dist/Containerfile .
```

This will build the image, which you can then use normally.