Skip to content

Update Git, openssh to latest and add support for https urls #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,48 @@ FROM mlupin/docker-lambda:provided.al2-build-${BUILD_ARCH}

ARG GIT_VERSION

RUN ulimit -n 1024 && yum -y update && yum -y install \
perl-IPC-Cmd \
&& yum clean all

RUN mkdir -p /root/openssl && cd /root/openssl && \
curl -L --output openssl.tgz https://www.openssl.org/source/openssl-1.1.1l.tar.gz && \
curl -L --output openssl.tgz https://www.openssl.org/source/openssl-3.2.0.tar.gz && \
tar zxf openssl.tgz

ARG BUILD_ARCH
RUN cd /root/openssl/openssl-1.1.1l && \
RUN cd /root/openssl/openssl-3.2.0 && \
[[ "${BUILD_ARCH}" == "x86_64" ]] && CONF_ARCH="linux-x86_64" || CONF_ARCH="linux-aarch64" && \
./Configure --prefix=/opt $CONF_ARCH && \
make NO_INSTALL_HARDLINKS=YesPlease -j8 && \
make NO_INSTALL_HARDLINKS=YesPlease install

RUN mkdir -p /root/openssh && cd /root/openssh && \
curl -L --output openssh.tgz https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz && \
curl -L --output openssh.tgz https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.6p1.tar.gz && \
tar zxf openssh.tgz

RUN cd /root/openssh/openssh-8.8p1/ && \
RUN cd /root/openssh/openssh-9.6p1/ && \
LD_LIBRARY_PATH=/opt/lib && \
./configure CFLAGS="-I/opt/include" --prefix=/opt --with-ldflags="-L/opt/lib" && \
make NO_INSTALL_HARDLINKS=YesPlease -j8 && \
make NO_INSTALL_HARDLINKS=YesPlease install

RUN mkdir -p /root/curl && cd /root/curl && \
curl -L --output curl.tgz https://curl.se/download/curl-8.5.0.tar.gz && \
tar zxf curl.tgz

RUN cd /root/curl/curl-8.5.0 && \
LD_LIBRARY_PATH=/opt/lib && \
./configure CFLAGS="-I/opt/include" --prefix=/opt --with-ldflags="-L/opt/lib" --with-openssl=/opt && \
make NO_INSTALL_HARDLINKS=YesPlease -j8 && \
make NO_INSTALL_HARDLINKS=YesPlease install

RUN mkdir -p /root/git && cd /root/git && \
curl -L --output git.tgz https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz && \
tar zxf git.tgz

RUN cd /root/git/git-${GIT_VERSION} && \
LD_LIBRARY_PATH=/opt/lib && \
./configure CFLAGS="-I/opt/include" --prefix=/opt --with-ldflags="-L/opt/lib" && \
./configure CFLAGS="-I/opt/include" --prefix=/opt --with-ldflags="-L/opt/lib" --with-curl=/opt && \
make NO_INSTALL_HARDLINKS=YesPlease -j8 && \
make NO_INSTALL_HARDLINKS=YesPlease install

Expand Down
2 changes: 1 addition & 1 deletion git_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.33.1
2.43.0
2 changes: 1 addition & 1 deletion includes/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ GIT_VERSION="$(cat ./git_version)"

step "Building ${ARCH} image for git ${GIT_VERSION}"
info "Executing docker build…"
docker build -t lambda-git-build:${GIT_VERSION}-${ARCH} --build-arg BUILD_ARCH=$ARCH --build-arg GIT_VERSION=2.33.1 . >docker-build.log 2>&1 || fatal 130 "There was an error while building the Docker image. Refer to ${ROOTDIR}/docker-build.log for details."
docker build -t lambda-git-build:${GIT_VERSION}-${ARCH} --build-arg BUILD_ARCH=$ARCH --build-arg GIT_VERSION=${GIT_VERSION} . >docker-build.log 2>&1 || fatal 130 "There was an error while building the Docker image. Refer to ${ROOTDIR}/docker-build.log for details."
rm docker-build.log
info "Docker build finished successfully"