@@ -166,6 +166,7 @@ var allTests = integration.TestFuncs(
166
166
testSBOMScannerArgs ,
167
167
testMultiPlatformWarnings ,
168
168
testNilContextInSolveGateway ,
169
+ testCopyUnicodePath ,
169
170
)
170
171
171
172
// Tests that depend on the `security.*` entitlements
@@ -6732,6 +6733,46 @@ func testNilContextInSolveGateway(t *testing.T, sb integration.Sandbox) {
6732
6733
require .ErrorContains (t , err , "invalid nil input definition to definition op" )
6733
6734
}
6734
6735
6736
+ func testCopyUnicodePath (t * testing.T , sb integration.Sandbox ) {
6737
+ f := getFrontend (t , sb )
6738
+ c , err := client .New (sb .Context (), sb .Address ())
6739
+ require .NoError (t , err )
6740
+ defer c .Close ()
6741
+
6742
+ dockerfile := []byte (`
6743
+ FROM alpine
6744
+ COPY test-äöü.txt /
6745
+ ` )
6746
+
6747
+ dir , err := integration .Tmpdir (
6748
+ t ,
6749
+ fstest .CreateFile ("Dockerfile" , dockerfile , 0600 ),
6750
+ fstest .CreateFile ("test-äöü.txt" , []byte ("test" ), 0644 ),
6751
+ )
6752
+ require .NoError (t , err )
6753
+
6754
+ destDir , err := integration .Tmpdir (t )
6755
+ require .NoError (t , err )
6756
+
6757
+ _ , err = f .Solve (sb .Context (), c , client.SolveOpt {
6758
+ Exports : []client.ExportEntry {
6759
+ {
6760
+ Type : client .ExporterLocal ,
6761
+ OutputDir : destDir ,
6762
+ },
6763
+ },
6764
+ LocalDirs : map [string ]string {
6765
+ dockerui .DefaultLocalNameDockerfile : dir ,
6766
+ dockerui .DefaultLocalNameContext : dir ,
6767
+ },
6768
+ }, nil )
6769
+ require .NoError (t , err )
6770
+
6771
+ dt , err := os .ReadFile (filepath .Join (destDir , "test-äöü.txt" ))
6772
+ require .NoError (t , err )
6773
+ require .Equal (t , "test" , string (dt ))
6774
+ }
6775
+
6735
6776
func runShell (dir string , cmds ... string ) error {
6736
6777
for _ , args := range cmds {
6737
6778
var cmd * exec.Cmd
0 commit comments