File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/vscode-container-client/src/test Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See LICENSE in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import * as fs from 'fs' ;
67import * as path from 'path' ;
78import * as stream from 'stream' ;
89import { describe , it } from 'mocha' ;
@@ -21,8 +22,21 @@ const executeInWsl = true; // Change this to false to run the tests on the host
2122
2223const client = new PodmanClient ( ) ;
2324let runner : ShellStreamCommandRunnerFactory < ShellStreamCommandRunnerOptions > | WslShellCommandRunnerFactory ;
25+
26+ const dockerfileContent = `
27+ FROM alpine:latest
28+
29+ EXPOSE 8080
30+ ` ;
31+
2432let testDockerfileContext : string = path . resolve ( __dirname , 'buildContext' ) ;
2533let testDockerfile : string = path . resolve ( testDockerfileContext , 'Dockerfile' ) ;
34+
35+ // Create the build context directory if it doesn't exist
36+ fs . mkdirSync ( testDockerfileContext , { recursive : true } ) ;
37+ // Write the Dockerfile to the build context directory
38+ fs . writeFileSync ( testDockerfile , dockerfileContent ) ;
39+
2640if ( executeInWsl ) {
2741 runner = new WslShellCommandRunnerFactory ( { strict : true } ) ;
2842 testDockerfileContext = wslifyPath ( testDockerfileContext ) ;
You can’t perform that action at this time.
0 commit comments