-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
112 additions
and
56 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
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
29 changes: 25 additions & 4 deletions
29
cmd/syft/internal/test/integration/test-fixtures/image-vertical-package-dups/Dockerfile
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,27 @@ | ||
FROM centos:7.9.2009@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4 | ||
FROM --platform=linux/amd64 rockylinux:9.3.20231119@sha256:d644d203142cd5b54ad2a83a203e1dee68af2229f8fe32f52a30c6e1d3c3a9e0 AS base | ||
|
||
# modifying the RPM DB multiple times will result in duplicate packages when using all-layers (if there was no de-dup logic) | ||
# curl is tricky, it already exists in the image and is being upgraded | ||
RUN yum install -y wget-1.14-18.el7_6.1 curl-7.29.0-59.el7_9.1 | ||
RUN yum install -y vsftpd-3.0.2-29.el7_9 | ||
RUN yum install -y httpd-2.4.6-97.el7.centos.5 | ||
|
||
# but... we want to make the test image as small as possible, so we are making the changes in stages and then | ||
# copying the RPM DB from each stage to a final stage in separate layers. This will result in a much smaller image. | ||
|
||
FROM base AS stage1 | ||
RUN dnf install -y wget | ||
|
||
FROM stage1 AS stage2 | ||
RUN dnf update -y curl-minimal | ||
|
||
FROM stage2 AS stage3 | ||
RUN dnf install -y vsftpd | ||
|
||
FROM stage3 AS stage4 | ||
RUN dnf install -y httpd | ||
|
||
FROM scratch | ||
|
||
COPY --from=base /var/lib/rpm /var/lib/rpm | ||
COPY --from=stage1 /var/lib/rpm /var/lib/rpm | ||
COPY --from=stage2 /var/lib/rpm /var/lib/rpm | ||
COPY --from=stage3 /var/lib/rpm /var/lib/rpm | ||
COPY --from=stage4 /var/lib/rpm /var/lib/rpm |
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
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,4 +1,4 @@ | ||
FROM centos:7.9.2009@sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f | ||
# all-layers scope should pickup on vsftpd | ||
RUN yum install -y vsftpd | ||
RUN yum remove -y vsftpd | ||
FROM --platform=linux/amd64 alpine:3.20.2@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78 | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk del curl |