Skip to content

Commit

Permalink
fix: make it possible split the args passed
Browse files Browse the repository at this point in the history
  • Loading branch information
mahyarmirrashed committed Dec 20, 2024
1 parent 537b1c3 commit 6561e0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ COPY . .

RUN CGO_ENABLED=0 go build -o app

FROM scratch
FROM alpine:3.21

RUN apk add --no-cache bash=5.2.37-r0

COPY --from=builder /app/app /usr/local/bin/

ENTRYPOINT ["app"]
COPY ./entrypoint.sh /usr/local/bin/

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

# Initialize an empty array to hold the arguments
args=()

# Use a while loop to split INPUT_INCLUDES by spaces and handle each token
while IFS= read -r -d ' ' token; do
args+=("$token")
done <<<"$INPUT_INCLUDES "

# Pass the arguments array to your main script
exec app "${args[@]}"

0 comments on commit 6561e0c

Please sign in to comment.