Troubleshooting
Before sumbitting a bug report please read the Troubleshooting doc.
Behaviour
Steps to reproduce this issue
- Create a Dockerfile with
RUN git describe --always > VERSION
- See it working locally
- see it failing on github actions
Expected behaviour
I expect that this works properly
Actual behaviour
I see the following in the error log:
#10 [ 7/11] RUN git describe --always > VERSION
#10 sha256:50f59aab7c36de632d818d4b6c44ba392fbde9110e40393f9834bd372996bc46
#10 0.093 fatal: not a git repository (or any of the parent directories): .git
#10 ERROR: executor failed running [/bin/sh -c git describe --always > VERSION]: exit code: 128
------
> [ 7/11] RUN git describe --always > VERSION:
------
Dockerfile:13
--------------------
11 | ADD . /vpt
12 |
13 | >>> RUN git describe --always > VERSION
14 |
15 | RUN gem install bundler \
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c git describe --always > VERSION]: exit code: 128
Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c git describe --always > VERSION]: exit code: 128
Configuration
name: test-build-release
on:
push:
branches: master
jobs:
test:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run tests
run: bundle exec rake rubocop
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
push: true
tags: latest
Logs
build.log
My guess here is that the .git directory is not available within the container. I did some digging in the code I'm not sure if my guess is correct.
Troubleshooting
Before sumbitting a bug report please read the Troubleshooting doc.
Behaviour
Steps to reproduce this issue
RUN git describe --always > VERSIONExpected behaviour
I expect that this works properly
Actual behaviour
I see the following in the error log:
Configuration
Logs
build.log
My guess here is that the .git directory is not available within the container. I did some digging in the code I'm not sure if my guess is correct.