Skip to content

Commit 8746f20

Browse files
Use POSIX mode for large numbers in tar archives (#4384) (#4388)
* Use POSIX mode for large numbers in tar archives (#4384) * PR feedback
1 parent 8464651 commit 8746f20

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

core/src/main/java/org/testcontainers/containers/ContainerState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ default void copyFileToContainer(Transferable transferable, String containerPath
272272
TarArchiveOutputStream tarArchive = new TarArchiveOutputStream(byteArrayOutputStream)
273273
) {
274274
tarArchive.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
275+
tarArchive.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
275276

276277
transferable.transferTo(tarArchive, containerPath);
277278
tarArchive.finish();

core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public void onNext(BuildResponseItem item) {
123123
// To build an image, we have to send the context to Docker in TAR archive format
124124
try (TarArchiveOutputStream tarArchive = new TarArchiveOutputStream(new GZIPOutputStream(out))) {
125125
tarArchive.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
126+
tarArchive.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
126127

127128
for (Map.Entry<String, Transferable> entry : transferables.entrySet()) {
128129
Transferable transferable = entry.getValue();

0 commit comments

Comments
 (0)