Merge pull request #14 from izissise/docker-uid
Allow to set uid guid when running whatsapp program
This commit is contained in:
commit
abab28f8a7
2 changed files with 13 additions and 1 deletions
|
@ -13,6 +13,12 @@ RUN go build -o /usr/bin/mautrix-whatsapp
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
|
ENV UID=1337 \
|
||||||
|
GID=1337
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
su-exec
|
||||||
|
|
||||||
COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
|
COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
|
||||||
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
||||||
COPY --from=builder /go/src/maunium.net/go/mautrix-whatsapp/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml
|
COPY --from=builder /go/src/maunium.net/go/mautrix-whatsapp/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Define functions.
|
||||||
|
function fixperms {
|
||||||
|
chown -R $UID:$GID /data /opt/mautrix-whatsapp
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -f /data/config.yaml ]; then
|
if [ ! -f /data/config.yaml ]; then
|
||||||
cp /opt/mautrix-whatsapp/example-config.yaml /data/config.yaml
|
cp /opt/mautrix-whatsapp/example-config.yaml /data/config.yaml
|
||||||
echo "Didn't find a config file."
|
echo "Didn't find a config file."
|
||||||
|
@ -18,4 +23,5 @@ if [ ! -f /data/registration.yaml ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /data
|
cd /data
|
||||||
/usr/bin/mautrix-whatsapp
|
fixperms
|
||||||
|
exec su-exec $UID:$GID /usr/bin/mautrix-whatsapp
|
||||||
|
|
Loading…
Reference in a new issue