diff --git a/ue4docker/dockerfiles/ue4-source/linux/Dockerfile b/ue4docker/dockerfiles/ue4-source/linux/Dockerfile index 73bab9b9..c95badf3 100644 --- a/ue4docker/dockerfiles/ue4-source/linux/Dockerfile +++ b/ue4docker/dockerfiles/ue4-source/linux/Dockerfile @@ -22,7 +22,7 @@ COPY ${SOURCE_LOCATION} /home/ue4/UnrealEngine # The git repository that we will clone ARG GIT_REPO="" -# The git branch/tag that we will checkout +# The git branch/tag/commit that we will checkout ARG GIT_BRANCH="" {% if credential_mode == "secrets" %} @@ -38,7 +38,18 @@ RUN chmod +x /tmp/git-credential-helper-secrets.sh ARG CHANGELIST RUN --mount=type=secret,id=username,uid=1000,required \ --mount=type=secret,id=password,uid=1000,required \ - CHANGELIST="$CHANGELIST" git clone --progress --depth=1 -b $GIT_BRANCH $GIT_REPO {{ clone_opts }} /home/ue4/UnrealEngine + CHANGELIST="$CHANGELIST" \ + mkdir /home/ue4/UnrealEngine && \ + cd /home/ue4/UnrealEngine && \ + git init && \ + {% if git_config %} + {% for key, value in git_config.items() %} + git config {{ key }} {{ value }} && \ + {% endfor %} + {% endif %} + git remote add origin "$GIT_REPO" && \ + git fetch --progress --depth 1 origin "$GIT_BRANCH" && \ + git checkout FETCH_HEAD {% else %} @@ -56,7 +67,17 @@ ENV GIT_ASKPASS=/tmp/git-credential-helper-endpoint.sh RUN chmod +x /tmp/git-credential-helper-endpoint.sh # Clone the UE4 git repository using the endpoint-supplied credentials -RUN git clone --progress --depth=1 -b $GIT_BRANCH $GIT_REPO {{ clone_opts }} /home/ue4/UnrealEngine +RUN mkdir /home/ue4/UnrealEngine && \ + cd /home/ue4/UnrealEngine && \ + git init && \ + {% if git_config %} + {% for key, value in git_config.items() %} + git config {{ key }} {{ value }} && \ + {% endfor %} + {% endif %} + git remote add origin "$GIT_REPO" && \ + git fetch --progress --depth 1 origin "$GIT_BRANCH" && \ + git checkout FETCH_HEAD {% endif %} diff --git a/ue4docker/dockerfiles/ue4-source/windows/Dockerfile b/ue4docker/dockerfiles/ue4-source/windows/Dockerfile index c4de71fa..62ee9dc5 100644 --- a/ue4docker/dockerfiles/ue4-source/windows/Dockerfile +++ b/ue4docker/dockerfiles/ue4-source/windows/Dockerfile @@ -23,7 +23,7 @@ COPY ${SOURCE_LOCATION} C:\UnrealEngine # The git repository that we will clone ARG GIT_REPO="" -# The git branch/tag that we will checkout +# The git branch/tag/commit that we will checkout ARG GIT_BRANCH="" # Retrieve the address for the host that will supply git credentials @@ -40,7 +40,17 @@ ENV GIT_ASKPASS=C:\git-credential-helper.bat # Clone the UE4 git repository using the host-supplied credentials WORKDIR C:\ -RUN git clone --progress --depth=1 -b %GIT_BRANCH% %GIT_REPO% {{ clone_opts }} C:\UnrealEngine +RUN mkdir C:\UnrealEngine && \ + cd C:\UnrealEngine && \ + git init && \ + {% if git_config %} + {% for key, value in git_config.items() %} + git config {{ key }} {{ value }} && \ + {% endfor %} + {% endif %} + git remote add origin %GIT_REPO% && \ + git fetch --progress --depth 1 origin %GIT_BRANCH% && \ + git checkout FETCH_HEAD {% endif %}