We intend to use Git Actions to build our Docker on every commit.
This is our current Git Actions yml:
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Navigate to app folder
run: cd app
- name: Open Directory
working-directory: app
run: |
ls -la
- name: Build docker image
run: docker build . -t app_name -f Dockerfile
The error I get is:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/runner/work/git-root/app/Dockerfile: no such file or directory
But in my ls -la i see the Dockerfile is present:
total 48
drwxr-xr-x 4 runner docker 4096 Sep 15 13:03 .
drwxr-xr-x 6 runner docker 4096 Sep 15 13:03 ..
-rw-r--r-- 1 runner docker 93 Sep 15 13:03 .env-template
-rw-r--r-- 1 runner docker 655 Sep 15 13:03 Dockerfile
I have tried:
- Using both
actions/checkout@v1andactions/checkout@v2 - cd into the directory with the Dockerfile
- setting Dockerfile directory to working-directory
Why does not the docker build find my Dockerfile?