Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] docker:not found #187

Closed
MaticSulc opened this issue Nov 16, 2023 · 1 comment
Closed

[BUG] docker:not found #187

MaticSulc opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MaticSulc
Copy link

Describe the bug
While running an action using the platform tags, it throws
/__w/_actions/elgohr/Publish-Docker-Github-Action/v5/entrypoint.sh: 32: /__w/_actions/elgohr/Publish-Docker-Github-Action/v5/entrypoint.sh: docker: not found

To Reproduce

name: Build and Deploy

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
  push:
    branches: [main]
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    container: node:16

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Publish to Registry
        uses: elgohr/Publish-Docker-Github-Action@v5
        #env:
          #NEXT_PUBLIC_BACKEND_URL: ${{ secrets.APP_NEXT_PUBLIC_BACKEND_URL }}
          #NEXT_PUBLIC_META_API_KEY: ${{ secrets.APP_NEXT_PUBLIC_META_API_KEY }}
        with:
          name: maticsulc/lorem/ipsum
          registry: ghcr.io
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets. GITHUB_TOKEN }}
          platforms: linux/amd64,linux/arm64
          #buildargs: NEXT_PUBLIC_BACKEND_URL,NEXT_PUBLIC_META_API_KEY
          tags: latest
  deploy:
    needs: build
    runs-on: ubuntu-latest

    steps:
      - name: Deploy package to Github Container Registry
        uses: appleboy/ssh-action@master
        env:
          GITHUB_USERNAME: ${{ secrets.USERNAME }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          host: ${{ secrets.DEPLOY_HOST }}
          port: ${{ secrets.DEPLOY_PORT }}
          username: ${{ secrets.DEPLOY_USER }}
          key: ${{ secrets.DEPLOY_KEY }}
          envs: GITHUB_USERNAME, GITHUB_TOKEN
          script: |
            docker login ghcr.io -u $GITHUB_USERNAME -p $GITHUB_TOKEN
            docker pull ghcr.io/maticsulc/lorem/ipsum:latest
            docker stop loremipsum
            docker system prune -f
            docker run --name loremipsum -dit -p 3000:3000 ghcr.io/maticsulc/lorem/ipsum:latest

Expected behavior
No error, and successful deployment.

@MaticSulc MaticSulc added the bug Something isn't working label Nov 16, 2023
@elgohr
Copy link
Owner

elgohr commented Nov 17, 2023

Looks like your environment (container) is missing docker.
This is not a bug regarding this action.

See

name: Build and Deploy

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
  push:
    branches: [main]
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    container: node:16

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - run: docker ps

errors as docker: not found (https://github.com/elgohr/test/actions/runs/6901303639/job/18775880567)

@elgohr elgohr closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants