Skip to content

Checkout isn’t working #120

@ThisIsQasim

Description

@ThisIsQasim

Behaviour

As per the docs, it should automatically checkout the repo before building the docker image. I am building an image with a build context of a subfolder and the working directory is empty.

Steps to reproduce this issue

  1. Try to build an image with a context other than .
  2. Build will fail citing missing directory

Expected behaviour

Repo should be cloned and build should succeed.

Actual behaviour

Repo is not cloned and build fails

Configuration

name: Docker Image CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v1
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v1
    - name: Login to DockerHub
      uses: docker/login-action@v1 
      with:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
    - name: Set current directory
      run: |
        pwd; ls; ls ..
    - name: Build and push
      id: docker_build
      uses: docker/build-push-action@v2
      env:
        VERSION: '7.8.0'
        ODFE_VERSION: '1.9.0.2'
        REPO: thisisqasim
      with:
        context: elasticsearch
        file: elasticsearch/Dockerfile
        build-args: VERSION=${{ env.VERSION }},ODFE_VERSION=${{ env.ODFE_VERSION }}
        platforms: linux/amd64,linux/arm64
        pull: true
        push: true
        tags: ${{ env.REPO }}/elasticsearch:${{ env.VERSION }}
    - name: Image digest
      run: echo ${{ steps.docker_build.outputs.digest }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions