forked from usnistgov/OSCAL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (34 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM ubuntu:22.04 as base-environment
ENV TZ=US/Eastern
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get dist-upgrade -y
FROM base-environment as oscal-os-dependencies
RUN apt-get install -y \
apt-utils build-essential git jq libxml2-utils maven nodejs npm python3-pip unzip wget && \
apt-get clean
FROM golang:1.18.3-bullseye as oscal-hugo-build
RUN mkdir -p /go/src/github.com/usnistgov/OSCAL/build
WORKDIR /go/src/github.com/usnistgov/OSCAL/build
ADD tools.go .
ADD go.mod .
ADD go.sum .
RUN go install -tags "extended" github.com/gohugoio/hugo
FROM oscal-os-dependencies as oscal-runtime-dependencies
RUN mkdir -p /opt/oscal
WORKDIR /opt/oscal
ADD ./ci-cd/python/requirements.txt .
ADD ./package.json .
ADD ./package-lock.json .
ADD ./pom.xml .
RUN npm ci && \
pip3 install -r requirements.txt && \
mvn dependency:copy-dependencies -DoutputDirectory=/opt/oscal
FROM oscal-runtime-dependencies as oscal-base
VOLUME ["/oscal"]
WORKDIR /oscal
FROM oscal-base as cli
COPY --from=oscal-hugo-build /go/bin/hugo /usr/local/bin
ENV SAXON_HOME=/opt/oscal
ENV CALABASH_HOME=${SAXON_HOME}
ENV PATH=/opt/oscal/node_modules/.bin:${PATH}
ENTRYPOINT ["/bin/bash"]