Skip to content

Commit

Permalink
feat(driver): add simple entrypoint script
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Goller <[email protected]>
  • Loading branch information
goller committed Jul 22, 2023
1 parent f9869f7 commit b462ba6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ RUN \
FROM --platform=$TARGETPLATFORM ubuntu:20.04

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /usr/bin/entrypoint.sh
COPY --from=build /out/depot /usr/bin/depot
COPY --from=build /out/buildkitd /usr/bin/buildkitd
COPY --from=build /out/buildctl /usr/bin/buildctl
ENTRYPOINT ["/usr/bin/depot"]

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
20 changes: 20 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

run_program() {
program_name=$1
shift
exec "/usr/bin/$program_name" "$@"
}

if [ $# -eq 0 ]; then
run_program "depot" "$@"
else
# buildkitd and buildctl are used to support buildx drivers.
if [ "$1" = "buildkitd" ]; then
run_program "$@"
elif [ "$1" = "buildctl" ]; then
run_program "$@"
else
run_program "depot" "$@"
fi
fi

0 comments on commit b462ba6

Please sign in to comment.