Skip to content
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

Problems with Git LFS and docker/build-push-action #161

Open
gugulet-hu-spreadai opened this issue Sep 13, 2024 · 0 comments
Open

Problems with Git LFS and docker/build-push-action #161

gugulet-hu-spreadai opened this issue Sep 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gugulet-hu-spreadai
Copy link

gugulet-hu-spreadai commented Sep 13, 2024

Multirepo is only pulling the Git LFS pointers from child repos, not the actual files. Even when lfs: true and the command git lfs pull is used in the Workflow. The build works locally, but not inside the docker/build-push-action.

The shortened workflow file:

...
               - name: GIT LFS Pull
                 run: cd .; git checkout main && git pull && git lfs pull; ls -alh temp_dir/child-repo/src

               - name: Build and Push
                 uses: docker/build-push-action@v5
                 with:
                      context: .
                      platforms: linux/amd64,linux/arm64
                      push: true
                      tags: ${{ steps.meta.outputs.tags }}
                      labels: ${{ steps.meta.outputs.labels }}
                      cache-from: type=gha
                      cache-to: type=gha,mode=max
                      build-args: |
                           GithubAccessToken=${{ secrets.GithubAccessToken }}
...

The run: cd .; git checkout main && git pull && git lfs pull; ls -alh child-repo/src returns a folder with the images correctly pulled in temp_dir.

But in the dockerfile, after multirepo has run the image files are now just pointers. This breaks the site that is produced:

FROM --platform=$BUILDPLATFORM python:3 AS build

WORKDIR /usr/src/app/internal

ARG GithubAccessToken

COPY internal/requirements.txt .
RUN apt-get update && apt-get install -y apt-transport-https
RUN pip3 install --no-cache-dir -r requirements.txt

COPY . /usr/src/app/

RUN ls -alh temp_dir/child-repo/src

RUN mkdocs build

RUN ls -alh temp_dir/child-repo/src
...

Is there any way to add git lfs pull along with shallow clones of the child repos? This should preferably be an option for people using Git LFS.

@jdoiro3 jdoiro3 added the bug Something isn't working label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants