I am using Github actions to build docker images with a file from git lfs.
I have the following step:
-
name: Checkout code
uses: actions/checkout@v2
with:
lfs: true
-
run: head something.json
Which prints the data correctly.
When I run the same command from my dockerfile in the build stage,
I get the following lfs metadata:
#7 [4/5] RUN head something.json
#7 sha256:***
#7 0.138 version https://git-lfs.github.com/spec/v1
#7 0.138 oid sha256:***
#7 0.138 size 1230424
#7 DONE 0.2s
Dockerfile:
FROM bitnami/python:3.9.1
COPY . .
RUN head something.json
Action:
jobs:
build-image:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v2
with:
lfs: true
-
run: head something.json
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile
Why the docker build takes the metadata and not the actual file?