diff --git a/bitnami/git/2/debian-11/Dockerfile b/bitnami/git/2/debian-11/Dockerfile index f9305c238b25..e16b3c24be53 100644 --- a/bitnami/git/2/debian-11/Dockerfile +++ b/bitnami/git/2/debian-11/Dockerfile @@ -3,10 +3,10 @@ FROM docker.io/bitnami/minideb:bullseye ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \ - org.opencontainers.image.created="2023-05-21T14:05:02Z" \ + org.opencontainers.image.created="2023-05-24T14:24:26Z" \ org.opencontainers.image.description="Application packaged by VMware, Inc" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="2.40.1-debian-11-r8" \ + org.opencontainers.image.ref.name="2.40.1-debian-11-r9" \ org.opencontainers.image.title="git" \ org.opencontainers.image.vendor="VMware, Inc." \ org.opencontainers.image.version="2.40.1" @@ -18,7 +18,7 @@ ENV OS_ARCH="${TARGETARCH:-amd64}" \ COPY prebuildfs / SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install required system packages and dependencies -RUN install_packages ca-certificates curl less libbrotli1 libcom-err2 libcurl4 libffi7 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 procps ssh zlib1g +RUN install_packages ca-certificates curl less libbrotli1 libcom-err2 libcurl4 libffi7 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed6 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle8 libnghttp2-14 libp11-kit0 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 procps zlib1g RUN mkdir -p /tmp/bitnami/pkg/cache/ && cd /tmp/bitnami/pkg/cache/ && \ COMPONENTS=( \ "git-2.40.1-1-linux-${OS_ARCH}-debian-11" \ @@ -36,6 +36,8 @@ RUN apt-get update && apt-get upgrade -y && \ apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives COPY rootfs / +RUN install_packages ssh && \ + rm -f /etc/ssh/ssh_host_* > /dev/null 2>&1 ENV APP_VERSION="2.40.1" \ BITNAMI_APP_NAME="git" \ NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \ diff --git a/bitnami/git/2/debian-11/rootfs/opt/bitnami/scripts/git/entrypoint.sh b/bitnami/git/2/debian-11/rootfs/opt/bitnami/scripts/git/entrypoint.sh index 7ac049b05735..e455b55b3d8e 100755 --- a/bitnami/git/2/debian-11/rootfs/opt/bitnami/scripts/git/entrypoint.sh +++ b/bitnami/git/2/debian-11/rootfs/opt/bitnami/scripts/git/entrypoint.sh @@ -6,6 +6,19 @@ set -o nounset set -o pipefail #set -o xtrace +# Generate new SSH key pairs if they don't exist +if [[ ! -f /etc/ssh/ssh_host_rsa_key ]]; then + ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" <</dev/null 2>&1 +fi + +if [[ ! -f /etc/ssh/ssh_host_ecdsa_key ]]; then + ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" <</dev/null 2>&1 +fi + +if [[ ! -f /etc/ssh/ssh_host_ed25519_key ]]; then + ssh-keygen -q -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" <</dev/null 2>&1 +fi + if ! getent passwd "$(id -u)" &>/dev/null && [ -e "$NSS_WRAPPER_LIB" ]; then export LD_PRELOAD="$NSS_WRAPPER_LIB" # shellcheck disable=SC2155