ungit: Ungit doesn't work inside a alpine container in versions after 1.4.26

Hi guys.

I don’t know what changed in ungit after version 1.4.26 but it stopped working in my node:8-alpine container. I’m currently only using version 1.4.26.

Below are the container logs:

Running /usr/local/bin/ungit
## Ungit started ##

Took 1346ms to start server.
Browse to http://localhost:8448/#/repository?path=%2Fgit
(node:1) UnhandledPromiseRejectionWarning: Error: Exited with code 3
    at ChildProcess.cp.once.code (/usr/local/lib/node_modules/ungit/node_modules/opn/index.js:84:13)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Here’s my old dockerfile. New one installs only version 1.4.26 of ungit with: npm install -g ungit@1.4.26

FROM node:8-alpine
MAINTAINER IPBurger <accounts@ipburger.com>

RUN \
    echo "Installing bash, git and openssh" \
    && apk add --update git openssh bash \
    && echo "Installing ungit with npm" \
    && npm install -g ungit \
    && echo "Cleaning apk..." \
    && apk del --progress --purge && rm -rf /var/cache/apk/* \
    && echo "ALL DONE"

COPY .ungitrc /root/.ungitrc

EXPOSE 8448

# https://docs.docker.com/engine/reference/builder/#workdir
WORKDIR /git

COPY entry.sh /entry.sh
ENTRYPOINT ["/entry.sh"]

CMD ["/usr/local/bin/ungit"]

Entrypoint:

#!/usr/bin/env bash

set -e

[ "$DEBUG" == 'true' ] && set -x

DAEMON=/usr/local/bin/ungit

stop() {
    echo "Received SIGINT or SIGTERM. Shutting down $DAEMON"
    pid=$(cat /var/run/$DAEMON/$DAEMON.pid)
    kill -SIGTERM "${pid}"
    wait "${pid}"
    echo "Done."
}

echo "Running $@"
if [ "$(basename $1)" == "$DAEMON" ]; then
    trap stop SIGINT SIGTERM
    $@ &
    pid="$!"
    mkdir -p /var/run/$DAEMON && echo "${pid}" > /var/run/$DAEMON/$DAEMON.pid
    wait "${pid}" && exit $?
else
    exec "$@"
fi

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I have confirmed that the issue is fixed with ungit 1.4.32 using the instructions from @vboufleur and adding --ungitBindIp 0.0.0.0.

@maxsennin Since ungit 1.4.30 you also need to specify ungitBindIp if you want to access ungit from another machine for security reasons (https://github.com/FredrikNoren/ungit/issues/988). You can get the previous behavior by using /usr/local/bin/ungit --ungitBindIp 0.0.0.0.

Ungit v1.4.30 is not available in npm yet for me to test it: https://www.npmjs.com/package/ungit

I tried v1.4.28 and 27 too. v1.4.26 was the first one that worked in my container.

Ah shoot, yeah either github hooks or travis logic changed and it didn’t get to build.

Will try to fix it tonight.