@@ -49,8 +49,8 @@ public class S3Container
4949
5050 public static final String POLICY_NAME = "managedPolicy" ;
5151
52- private static final String IMAGE_NAME = " minio/minio" ;
53- private static final String IMAGE_TAG = "RELEASE.2024-07-15T19-02-30Z " ;
52+ // Keep in sync with dep. minio.version in pom.xml
53+ private static final String IMAGE = "cgr.dev/chainguard/minio@sha256:66bd82c8fe5e75868ae7d0b2e102d9a0dcf971b270a41bd060a9e6a643476ff8 " ;
5454
5555 private static final String CONFIG_TEMPLATE = """
5656 {
@@ -111,7 +111,7 @@ public S3Container(@ForS3Container List<String> initialBuckets, @ForS3Container
111111 Transferable config = Transferable .of (CONFIG_TEMPLATE .formatted (credential .accessKey (), credential .secretKey ()));
112112 Transferable policyFile = Transferable .of (POLICY );
113113
114- container = new MinIOContainer (DockerImageName .parse (IMAGE_NAME ). withTag ( IMAGE_TAG ))
114+ container = new MinIOContainer (DockerImageName .parse (IMAGE ). asCompatibleSubstituteFor ( "minio/minio" ))
115115 .withUserName (credential .accessKey ())
116116 .withPassword (credential .secretKey ())
117117 .withEnv ("MC_CONFIG_DIR" , "/root/.mc/" )
@@ -120,6 +120,8 @@ public S3Container(@ForS3Container List<String> initialBuckets, @ForS3Container
120120 .withCopyToContainer (policyFile , "/root/policy.json" );
121121
122122 container .withEnv ("MINIO_DOMAIN" , LOCALHOST_DOMAIN );
123+ // Required to create buckets externally
124+ container .withCreateContainerCmdModifier (cmd -> cmd .withUser ("root" ));
123125 container .start ();
124126
125127 log .info ("S3 container started on port: %s" , container .getFirstMappedPort ());
0 commit comments