Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
feat: dpkg (#76), scanning of distroless container images with quay/c…
Browse files Browse the repository at this point in the history
…lair
  • Loading branch information
jhagestedt authored Jun 26, 2020
1 parent 1d82049 commit 7dd15aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM gcr.io/distroless/java:11
COPY target/*.jar app.jar
COPY scripts/Dpkg.java Dpkg.java
RUN ["java", "Dpkg.java"]
USER 65534:65534
CMD ["app.jar"]
EXPOSE 8080
15 changes: 0 additions & 15 deletions DockerfilePaaS

This file was deleted.

21 changes: 21 additions & 0 deletions scripts/Dpkg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.io.*;

class Dpkg {
public static void main(String[] args) throws IOException {
File dir = new File("/var/lib/dpkg/status.d/");
PrintWriter pw = new PrintWriter("/var/lib/dpkg/status");
String[] fileNames = dir.list();
for (String fileName : fileNames) {
System.out.println("Handling file: " + fileName);
File f = new File(dir, fileName);
BufferedReader br = new BufferedReader(new FileReader(f));
String line = br.readLine();
while (line != null) {
pw.println(line);
line = br.readLine();
}
pw.println();
pw.flush();
}
}
}

0 comments on commit 7dd15aa

Please sign in to comment.