question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
campersaucommented, Sep 2, 2018

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.

2reactions
campersaucommented, Sep 2, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use the Alpine Docker Official Image
Learn how to Dockerize Alpine for your next application or server with our guide on how to use the Alpine Docker Official Image....
Read more >
"date -d" command fails on Docker Alpine Linux container
Please note that the problem seems to be related to the BusyBox implementation of date since the OP is running the command inside...
Read more >
Docker Node Alpine Image Build Fails on node-gyp
I'm attempting to Dockerize a Vue. js application. I'm using the node:10.15-alpine Docker image as a base. The image build fails with the...
Read more >
Stop using Alpine Docker images | Inside SumUp - Medium
At SumUp, we use Kubernetes with Docker images a lot, so we are always looking for the best options when it comes to...
Read more >
Install .NET on Alpine - Microsoft Learn
NET SDK, you don't need to install the corresponding runtime. To install the .NET SDK, run the following command:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found