From b2704121262784161b587c6b1f1c69854d2f1609 Mon Sep 17 00:00:00 2001 From: Matteo Saloni Date: Fri, 20 Sep 2024 13:50:02 +0200 Subject: [PATCH] fix: python build should set WORKDIR for user instructions --- .../runtime/python/runners/PythonBuildRunner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/runners/PythonBuildRunner.java b/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/runners/PythonBuildRunner.java index b45de928..28ee215e 100644 --- a/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/runners/PythonBuildRunner.java +++ b/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/runners/PythonBuildRunner.java @@ -162,10 +162,13 @@ public K8sKanikoRunnable produce(Run run) { ".txt" ); + //set workdir from now on + dockerfileGenerator.workdir("/shared"); + // Add user instructions Optional .ofNullable(taskSpec.getInstructions()) - .ifPresent(instructions -> instructions.forEach(i -> dockerfileGenerator.run(i))); + .ifPresent(instructions -> instructions.forEach(dockerfileGenerator::run)); // If requirements.txt are defined add to build if (functionSpec.getRequirements() != null && !functionSpec.getRequirements().isEmpty()) {