remove self compiled mercurial and use latest from apk

This commit is contained in:
Sebastian Sdorra
2020-07-02 07:03:48 +02:00
parent 3f857fec04
commit 999c2672e3

View File

@@ -22,20 +22,6 @@
# 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
@@ -43,17 +29,13 @@ ENV CACHE_DIR=/var/cache/scm/work
COPY . /
RUN set -x \
&& apk add --no-cache python2 bash ca-certificates \
&& apk add --no-cache mercurial bash ca-certificates \
&& 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} \
&& chmod +x /opt/scm-server/bin/scm-server \
&& 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