尝试运行以下工作流程,但当它尝试登录 AWS 时失败。似乎无法找到码头工人:
/bin/docker exec 3a35b843bb4193a520ad9466e6f4ed6308bd01564cb0e7f38ac5976249bb94a4 sh -c "cat /etc/*release | grep ^ID" ##[错误]无法找到可执行文件:docker。请验证文件路径是否存在,或者该文件是否可以在 PATH 环境变量指定的目录中找到。还要检查文件模式以验证文件是否可执行。
我们的自托管运行器是安装了 docker 的 VM,容器基于python:3.8-alpine
. 谁能告诉我如何使用容器在自托管运行器中运行 docker 命令?安装docker socket卷与否,错误是一样的。
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 }}