grim/hgkeeper

Use Go 1.22 and update dependencies
default tip
2 months ago, aklitzing
f33f223bc8fe
Use Go 1.22 and update dependencies

Reviewed at https://reviews.imfreedom.org/r/2949/
FROM docker.io/golang:1.22-alpine as build
WORKDIR /root
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static" -s' .
FROM alpine:3
ENV HGKEEPER_THEME_URL=https://keep.imfreedom.org/grim/hgkeeper-theme/archive/default.tar.gz
RUN set -ex && \
apk upgrade --available --update-cache && \
apk add py3-pygments openssh-client mercurial-chg procps curl ca-certificates && \
apk add --virtual deps python3-dev py3-pip py3-setuptools build-base && \
pip3 install --break-system-packages --no-binary :all: hg-evolve hgwebplus && rm -r ~/.cache && \
apk del deps && \
rm -rf /var/cache/apk
RUN set -ex && \
addgroup -g 22271 hg && \
adduser -D -h /var/lib/hg -u 22271 -G hg hg
# install the hgkeeper theme
RUN set -ex && \
cd /tmp && \
wget -O - "${HGKEEPER_THEME_URL}" | tar zx && \
HGINST=$(python3 -c 'import mercurial; print(mercurial.__path__[0])') && \
cp -a /tmp/hgkeeper-theme-default/templates/hgkeeper/ $HGINST/templates/ && \
cp -a /tmp/hgkeeper-theme-default/templates/static/hgk/ $HGINST/templates/static/ && \
rm -rf /tmp/hgkeeper-theme-default
# setup the global mercurial configuration
COPY hgrc /etc/mercurial/hgrc
COPY --from=build /root/hgkeeper /usr/local/bin/hgkeeper
CMD ["hgkeeper", "serve"]