0

Trying to run the workflow below, but when it tries to login into AWS it fails. Doesn't seem to be able to find docker:

/bin/docker exec 3a35b843bb4193a520ad9466e6f4ed6308bd01564cb0e7f38ac5976249bb94a4 sh -c "cat /etc/*release | grep ^ID" ##[error]Unable to locate executable file: docker. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

Our self-hosted runners are VMs, which have docker installed, and the container is based on python:3.8-alpine. Can anybody tell me how do I run docker commands inside a self-hosted runner, using container? Mounting the docker socket volume or not, the error is the same.

name: Deploy to Stage

on:
  pull_request:
    types: [closed]
    branches:
      - dev
  push:
    branches:
      - feat-k8s

jobs:
  DeployToStage:
    runs-on: self-hosted
    container:
      image: edlut/azion:monster-python3
      options: --privileged
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock

    steps:
      - uses: actions/checkout@v2

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.ECR_ID }}
          aws-secret-access-key: ${{ secrets.ECR_KEY }}
          aws-region: us-east-1

      - name: Login to Amazon ECR 
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1

      - name: Build and push Docker images
        uses: docker/build-push-action@v1
        with:
          registry: ${{ steps.login-ecr.outputs.registry }}
          repository: 112233445566.dkr.ecr.us-east-1.amazonaws.com/monster-processor
          tags: ${{ github.sha }}
Marko E
  • 13,362
  • 2
  • 19
  • 28
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
  • I think there are some additional steps when running Docker inside of an Alpine image. More info here: https://stackoverflow.com/questions/54099218/how-can-i-install-docker-inside-an-alpine-container. – Marko E Aug 15 '20 at 10:02
  • 1
    Weird ... tried this before, but didn't worked. Tried it now, and worked just fine. Need to make breaks more often. Thanks for the help @MarkoE! – Vini.g.fer Aug 15 '20 at 12:15

0 Answers0