This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dpkg (#76), scanning of distroless container images with quay/c…
…lair
- Loading branch information
1 parent
1d82049
commit 7dd15aa
Showing
3 changed files
with
24 additions
and
16 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
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 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} |