use mercurial 4.9.1 with python 2

This commit is contained in:
Sebastian Sdorra
2020-06-04 09:52:17 +02:00
parent c924d73115
commit 8a1496f8da

View File

@@ -22,6 +22,20 @@
# SOFTWARE.
#
# we need to build mercurial by ourself,
# because we need mercurial with python 2 for now
# TODO remove if python3 support is available for scm-manager hg extensions
FROM adoptopenjdk/openjdk11:jdk-11.0.7_10-alpine-slim as build
WORKDIR /src
RUN apk add --upgrade alpine-sdk python2 python2-dev
RUN set -x \
&& wget https://www.mercurial-scm.org/release/mercurial-4.9.1.tar.gz \
&& tar xvfz mercurial-4.9.1.tar.gz \
&& rm -f mercurial-4.9.1.tar.gz
WORKDIR /src/mercurial-4.9.1
RUN make build
RUN make PREFIX=/usr install-bin
FROM adoptopenjdk/openjdk11:jdk-11.0.7_10-alpine-slim
ENV SCM_HOME=/var/lib/scm
ENV CACHE_DIR=/var/cache/scm/work
@@ -29,12 +43,16 @@ ENV CACHE_DIR=/var/cache/scm/work
COPY . /
RUN set -x \
&& apk add --no-cache mercurial bash \
&& apk add --no-cache python2 bash \
&& addgroup -S -g 1000 scm \
&& adduser -S -s /bin/false -G scm -h ${SCM_HOME} -D -H -u 1000 scm \
&& mkdir -p ${SCM_HOME} ${CACHE_DIR} \
&& chown scm:scm ${SCM_HOME} ${CACHE_DIR}
# copy mercurial installation
COPY --from=build /usr/bin/hg /usr/bin/hg
COPY --from=build /usr/lib/python2.7 /usr/lib/python2.7
WORKDIR "/opt/scm-server"
VOLUME ["${SCM_HOME}", "${CACHE_DIR}"]
EXPOSE 8080