default SELF withFileFromString(String path, String content) {
        return ((SELF) this).withFileFromTransferable(
                path,
                new Transferable() {
                    @Getter
                    byte[] bytes = content.getBytes();

                    @Override
                    public long getSize() {
                        return bytes.length;
                    }

                    @Override
                    public String getDescription() {
                        return "String: " + StringUtils.abbreviate(content, 100);
                    }
                }
            );
    }
BuildContextBuilder's trait for String-based manipulations.
core/src/main/java/org/testcontainers/images/builder/traits/StringsTrait.java