-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
FROM registry.access.redhat.com/ubi8/ruby-26 | ||
ENV HEIMDALLTOOLS_VERSION 1.3.6 | ||
MAINTAINER [email protected] | ||
FROM ruby:alpine as builder | ||
|
||
LABEL name="Heimdall Tools" \ | ||
vendor="MTIRE" \ | ||
version="${HEIMDALLTOOLS_VERSION}" \ | ||
|
@@ -9,22 +8,25 @@ LABEL name="Heimdall Tools" \ | |
description="HeimdallTools supplies several methods to convert output from various tools to \"Heimdall Data Format\"(HDF) format to be viewable in Heimdall" \ | ||
docs="https://github.com/mitre/heimdall_tools" \ | ||
run="docker run -d --name ${NAME} ${IMAGE} <args>" | ||
USER 0 | ||
|
||
RUN groupadd -r heimdall_tools \ | ||
&& useradd -r -g heimdall_tools heimdall_tools \ | ||
&& mkdir -p /opt/app-root/ \ | ||
&& chown -R heimdall_tools.heimdall_tools /opt/app-root/ | ||
RUN mkdir -p /share | ||
RUN apk add --no-cache build-base git-lfs openssl-dev | ||
|
||
COPY . /build | ||
RUN cd /build && \ | ||
bundle install && \ | ||
gem build heimdall_tools.gemspec -o heimdall_tools.gem | ||
|
||
|
||
USER heimdall_tools | ||
FROM ruby:alpine | ||
|
||
RUN git clone https://github.com/mitre/heimdall_tools /opt/app-root/heimdall_tools \ | ||
&& cd /opt/app-root/heimdall_tools \ | ||
&& bundle install --path /opt/app-root/ \ | ||
&& rm -rf /opt/app-root/heimdall_tools/docs \ | ||
&& rm -rf /opt/app-root/heimdall_tools/sample_jsons | ||
RUN apk add --no-cache build-base | ||
|
||
VOLUME /opt/data | ||
WORKDIR /opt/app-root/heimdall_tools | ||
COPY --from=builder /build/heimdall_tools.gem /build/ | ||
RUN gem install build/heimdall_tools.gem | ||
|
||
RUN apk del build-base | ||
|
||
ENTRYPOINT ["bundle","exec","./heimdall_tools"] | ||
ENTRYPOINT ["heimdall_tools"] | ||
VOLUME ["/share"] | ||
WORKDIR /share |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters