docker: Enable the sample hook files to execute without error (#256)

- Include jq package in the Dockerfile for parsing JSON
- Use sh instead of bash which is not available in Alpine Linux
This commit is contained in:
Rija Ménagé 2019-03-31 01:16:53 +08:00 committed by Marius
parent 56acce823d
commit 82bd6c796a
6 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
id="$TUS_ID"
offset="$TUS_OFFSET"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
echo "Upload $TUS_ID ($TUS_SIZE bytes) finished"
cat /dev/stdin | jq .

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
id="$TUS_ID"
offset="$TUS_OFFSET"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
echo "Upload $TUS_ID terminated"
cat /dev/stdin | jq .

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
filename=$(cat /dev/stdin | jq .MetaData.filename)
if [ -z "$filename" ]; then

View File

@ -22,7 +22,7 @@ FROM alpine:3.8
COPY --from=builder /go/bin/tusd /usr/local/bin/tusd
RUN apk add --no-cache ca-certificates \
RUN apk add --no-cache ca-certificates jq \
&& addgroup -g 1000 tusd \
&& adduser -u 1000 -G tusd -s /bin/sh -D tusd \
&& mkdir -p /srv/tusd-hooks \