Skip to content

Instantly share code, notes, and snippets.

@FabianPastor
Created September 19, 2018 11:58
Show Gist options
  • Save FabianPastor/5e1d8b2c5a86bced2a15f7e62edb6b0e to your computer and use it in GitHub Desktop.
Save FabianPastor/5e1d8b2c5a86bced2a15f7e62edb6b0e to your computer and use it in GitHub Desktop.
Dockerfile for Building static git binary for CentOS6.8
FROM centos:6.8 #Informatic class OS //Centos 6.8
RUN yum -y update
RUN yum -y install git gettext gettext-devel zlib-devel libcurl-devel tcp_wrappers-devel libxml2 libxml2-devel libxslt libxslt-devel expat-devel openssl-devel gcc make
RUN mkdir -p /app/git-static
WORKDIR /app
RUN git clone --recursive https://github.com/git/git.git --depth 1
# --recursive because centos has an outdated git version
RUN cd git && \
make prefix=/app/git-static CFLAGS="${CFLAGS} -static-libgcc" && \
make prefix=/app/git-static install
#sudo docker build -t centosgit:lastest
#sudo docker run -it centosgit:lastest --name dummy bash
#sudo docker cp dummy:/app/git-static ./git-static
#sudo docker container rm dummy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment