forked from deep-security/smartcheck-scan-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (42 loc) · 2.05 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
54
55
56
# This target exists to enable targeted building for running tests
FROM node:10-alpine@sha256:07897ec27318d8e43cfc6b1762e7a28ed01479ba4927aca0cdff53c1de9ea6fd as builder
WORKDIR /code
# keep package.json separate so that we can cache the npm install step more often
COPY package*.json /code/
RUN npm install --quiet
COPY . /code/
RUN npm run build
RUN npm run test
################################################################################
FROM node:10-alpine@sha256:07897ec27318d8e43cfc6b1762e7a28ed01479ba4927aca0cdff53c1de9ea6fd as prod-install
WORKDIR /app/
COPY --from=builder /code/package*.json /app/
RUN npm install --production
COPY --from=builder /code/build/ /app/dist/
################################################################################
FROM node:10-alpine@sha256:07897ec27318d8e43cfc6b1762e7a28ed01479ba4927aca0cdff53c1de9ea6fd as docker-install
RUN apk update && \
apk add curl
WORKDIR /tmp
ENV VERSION "18.09.3"
RUN curl -L -o /tmp/docker-$VERSION.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VERSION.tgz \
&& tar -xz -f /tmp/docker-$VERSION.tgz \
&& mv docker/docker /usr/bin
################################################################################
FROM node:10-alpine@sha256:07897ec27318d8e43cfc6b1762e7a28ed01479ba4927aca0cdff53c1de9ea6fd
# See GitHub Action label docs
# https://developer.github.com/actions/creating-github-actions/creating-a-docker-container/#label
LABEL "com.github.actions.name"="Deep Security Smart Check Scan"
LABEL "com.github.actions.description"="Scan container images with Deep Security Smart Check."
LABEL "com.github.actions.icon"="shield"
LABEL "com.github.actions.color"="gray-dark"
LABEL "maintainer"="Trend Micro"
LABEL "repository"="https://github.com/deep-security/smartcheck-scan-action"
LABEL "homepage"="https://www.trendmicro.com/smartcheck"
RUN apk update && \
apk upgrade && \
rm -rf /var/cache/apk/*
COPY --from=prod-install /app/ /app/
COPY --from=docker-install /usr/bin/docker /usr/bin/docker
WORKDIR /app/
ENTRYPOINT ["node", "/app/dist/index.js"]