Skip to content

Commit 6e7e1f9

Browse files
authored
Merge pull request #425 from snyk/feat/docker-plugin-with-rpm-parser
feat: use a library to scan RPM packages instead of an external tool
2 parents 46bed67 + ba69032 commit 6e7e1f9

File tree

6 files changed

+77
-172
lines changed

6 files changed

+77
-172
lines changed

Dockerfile

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ RUN cd $GOPATH/src/github.com/containers/skopeo \
1010
&& make install
1111

1212
#---------------------------------------------------------------------
13-
# STAGE 2: Build the go-rpmdb tool.
14-
#---------------------------------------------------------------------
15-
FROM golang:1.13.1-alpine3.10 AS rpmdb-build
16-
17-
RUN apk --no-cache add git gcc musl-dev db-dev openssl-dev
18-
RUN git clone --depth 1 -b 'v1.1.0' https://github.com/snyk/go-rpmdb $GOPATH/src/github.com/snyk/go-rpmdb
19-
RUN cd $GOPATH/src/github.com/snyk/go-rpmdb \
20-
&& GIT_COMMIT=$(git rev-parse HEAD 2> /dev/null || true) \
21-
&& GO111MODULE=on go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -o rpmdb ./cmd/rpmdb
22-
23-
#---------------------------------------------------------------------
24-
# STAGE 3: Build the kubernetes-monitor
13+
# STAGE 2: Build the kubernetes-monitor
2514
#---------------------------------------------------------------------
2615
FROM node:erbium-alpine
2716

@@ -31,7 +20,7 @@ ENV NODE_ENV production
3120

3221
RUN apk update
3322
RUN apk upgrade
34-
RUN apk --no-cache add db dumb-init
23+
RUN apk --no-cache add dumb-init
3524

3625
RUN addgroup -S -g 10001 snyk
3726
RUN adduser -S -G snyk -h /srv/app -u 10001 snyk
@@ -43,8 +32,6 @@ COPY --chown=snyk:snyk --from=skopeo-build /usr/bin/skopeo /usr/bin/skopeo
4332
COPY --chown=snyk:snyk --from=skopeo-build /etc/containers/registries.d/default.yaml /etc/containers/registries.d/default.yaml
4433
COPY --chown=snyk:snyk --from=skopeo-build /etc/containers/policy.json /etc/containers/policy.json
4534

46-
COPY --chown=snyk:snyk --from=rpmdb-build /go/src/github.com/snyk/go-rpmdb/rpmdb /usr/bin/rpmdb
47-
4835
# Add manifest files and install before adding anything else to take advantage of layer caching
4936
ADD --chown=snyk:snyk package.json package-lock.json .snyk ./
5037

0 commit comments

Comments
 (0)