From d642ab50bb363442969753272beb0dd408b771ae Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Thu, 26 Nov 2020 08:23:21 -0500 Subject: [PATCH] fix: don't assume /workspace in go builder (#53) Fixes: https://github.com/boson-project/buildpacks/issues/40 Signed-off-by: Lance Ball --- buildpacks/go/bin/build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildpacks/go/bin/build b/buildpacks/go/bin/build index adf4bcd..c7fb190 100755 --- a/buildpacks/go/bin/build +++ b/buildpacks/go/bin/build @@ -9,8 +9,8 @@ layers_dir="$1" # INJECT INVOCATION SCAFFOLDING (main) cp -r $bp_dir/faas $build_dir/faas -mkdir -p bin -go build -o bin/faas ./faas +mkdir -p $build_dir/bin +go build -o $build_dir/bin/faas $build_dir/faas # PLACE COMPILED BINARY IN APP LAYER FOR LAUNCH app_layer="$layers_dir/app" @@ -21,10 +21,10 @@ build = false cache = false EOF -cp ./bin/faas "$app_layer/faas" +cp $build_dir/bin/faas "$app_layer/faas" # REMOVE SOURCE CODE FROM FINAL CONTAINER -rm -rf /workspace/* +rm -rf $build_dir/* # LAUNCHER cat > "$layers_dir/launch.toml" << EOF