Skip to content
This repository was archived by the owner on Apr 29, 2026. It is now read-only.

Commit ccaa79e

Browse files
jsa5593John
andauthored
Updated the Dockerfile to run in an alpine ruby container (#47)
* Updated the Dockerfile to run in an alpine ruby container * Updated the README to have the docker command information * resolved pr comments Co-authored-by: John <atwoodj@mitre.org>
1 parent b1267a8 commit ccaa79e

2 files changed

Lines changed: 26 additions & 17 deletions

File tree

Dockerfile

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
FROM registry.access.redhat.com/ubi8/ruby-26
2-
ENV HEIMDALLTOOLS_VERSION 1.3.6
3-
MAINTAINER rx294@nyu.edu
1+
FROM ruby:alpine as builder
2+
43
LABEL name="Heimdall Tools" \
54
vendor="MTIRE" \
65
version="${HEIMDALLTOOLS_VERSION}" \
@@ -9,22 +8,25 @@ LABEL name="Heimdall Tools" \
98
description="HeimdallTools supplies several methods to convert output from various tools to \"Heimdall Data Format\"(HDF) format to be viewable in Heimdall" \
109
docs="https://github.com/mitre/heimdall_tools" \
1110
run="docker run -d --name ${NAME} ${IMAGE} <args>"
12-
USER 0
1311

14-
RUN groupadd -r heimdall_tools \
15-
&& useradd -r -g heimdall_tools heimdall_tools \
16-
&& mkdir -p /opt/app-root/ \
17-
&& chown -R heimdall_tools.heimdall_tools /opt/app-root/
12+
RUN mkdir -p /share
13+
RUN apk add --no-cache build-base git-lfs openssl-dev
14+
15+
COPY . /build
16+
RUN cd /build && \
17+
bundle install && \
18+
gem build heimdall_tools.gemspec -o heimdall_tools.gem
19+
1820

19-
USER heimdall_tools
21+
FROM ruby:alpine
2022

21-
RUN git clone https://github.com/mitre/heimdall_tools /opt/app-root/heimdall_tools \
22-
&& cd /opt/app-root/heimdall_tools \
23-
&& bundle install --path /opt/app-root/ \
24-
&& rm -rf /opt/app-root/heimdall_tools/docs \
25-
&& rm -rf /opt/app-root/heimdall_tools/sample_jsons
23+
RUN apk add --no-cache build-base
2624

27-
VOLUME /opt/data
28-
WORKDIR /opt/app-root/heimdall_tools
25+
COPY --from=builder /build/heimdall_tools.gem /build/
26+
RUN gem install build/heimdall_tools.gem
27+
28+
RUN apk del build-base
2929

30-
ENTRYPOINT ["bundle","exec","./heimdall_tools"]
30+
ENTRYPOINT ["heimdall_tools"]
31+
VOLUME ["/share"]
32+
WORKDIR /share

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ Verify the installed version number:
5353
On the Command Line, `heimdall_tools help` will print a listing of all the command with a short description.
5454
For detailed help on any command, run `heimdall_tools help [COMMAND]`. Help can also be called with the `-h, --help` flags after any command, like `heimdall_tools fortify_mapper -h`.
5555

56+
For Docker usage, replace the `heimdall_tools` command with the correct Docker command below for your operating system:
57+
58+
- **On Linux and Mac:** `docker run -it -v$(pwd):/share mitre/heimdall_tools`
59+
- **On Windows CMD:** `docker run -it -v%cd%:/share mitre/heimdall_tools`
60+
61+
Note that all of the above Docker commands will mount your current directory on the Docker container. Ensure that you have navigated to the directory you intend to convert files in before executing the command.
62+
5663
## sonarqube_mapper
5764

5865
sonarqube_mapper pulls SonarQube results, for the specified project, from the API and outputs in HDF format Json to be viewed on Heimdall

0 commit comments

Comments
 (0)