forked from opensbom-generator/spdx-sbom-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (26 loc) · 776 Bytes
/
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
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.17-alpine AS build
ARG VERSION=latest
ARG GIT_HASH
WORKDIR /src
# Allow for caching
COPY go.mod go.sum ./
RUN go mod download
COPY / .
RUN GO111MODULE=on GOFLAGS=-mod=vendor go mod vendor
RUN GO111MODULE=on GOFLAGS=-mod=vendor go mod tidy
RUN GO111MODULE=on GOFLAGS=-mod=vendor CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o spdx-sbom-generator ./cmd/generator/generator.go
FROM alpine
ENV USERNAME=spdx-sbom-generator
# Ruby
RUN apk add --update ruby && gem install bundler
# Go
RUN apk add go
# Java
RUN apk add --update maven
# Node
RUN apk add --update nodejs npm && npm install -g yarn
COPY --from=build /src/spdx-sbom-generator /spdx-sbom-generator
ENTRYPOINT ["/spdx-sbom-generator"]
CMD ["-h"]