forked from alpine-docker/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 771 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM alpine AS compile-image
LABEL maintainer Christophe Deliens <chris@deliens.be>
WORKDIR /tmp
RUN apk --update add build-base openssh curl autoconf zlib-dev curl-dev
# TODO: optimise compiled binary size
ENV GIT_VERSION 2.15.0
RUN mkdir -p /usr/src/git && \
curl -L https://github.com/git/git/archive/v$GIT_VERSION.tar.gz | tar xvz -C /usr/src/git --strip 1 && \
cd /usr/src/git && \
make configure && \
./configure NO_TCLTK=YesPlease NO_PERL=YesPlease NO_EXPAT=YesPlease NO_GETTEXT=YesPlease && \
make install
# ---
FROM alpine AS final-image
RUN apk --update add openssh && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*
COPY --from=compile-image /usr/local/bin/git* /usr/local/bin/
VOLUME /git
WORKDIR /git
ENTRYPOINT ["git"]
CMD ["--help"]