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

devcontainers/[email protected] return "::error::Unable to locate executable file: docker." #275

Open
alanlivio opened this issue Jan 30, 2024 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@alanlivio
Copy link

I am trying to use the devcontainers/[email protected] action (see workflow and devcontainer below).
I am running it in a local environment using nektos act before run at Github (see log bellow).
However, I got the error "::error::Unable to locate executable file: docker."
Am I missing something?

.github/workflows/hugo.yml

name: deploy-hugo-to-ghpages
on:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Build at devcontainer 
        uses: devcontainers/[email protected]
        with:
          runCmd: |
            hugo --gc  --minify

.devcontainer.json

// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/hugo
{
	"name": "Hugo",
	"image": "mcr.microsoft.com/devcontainers/base:ubuntu", // Any generic, debian-based image.
	"features": {
		"ghcr.io/devcontainers/features/go:1": {},
		"ghcr.io/devcontainers/features/hugo:1": {
			"version": "0.119.0",
			"extended": true
		},
	},
	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	"forwardPorts": [
		1313
	]
}

gh act -W .github/workflows/hugo.yml

[deploy-hugo-to-ghpages/build] 🚀  Start image=node:16-buster-slim
INFO[0000] Parallel tasks (0) below minimum, setting to 1
[deploy-hugo-to-ghpages/build]   🐳  docker pull image=node:16-buster-slim platform= username= forcePull=true
INFO[0001] Parallel tasks (0) below minimum, setting to 1
[deploy-hugo-to-ghpages/build]   🐳  docker create image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[deploy-hugo-to-ghpages/build]   🐳  docker run image=node:16-buster-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[deploy-hugo-to-ghpages/build]   ☁  git clone 'https://github.com/devcontainers/ci' # ref=v0.3
[deploy-hugo-to-ghpages/build] ⭐ Run Main Checkout
[deploy-hugo-to-ghpages/build]   🐳  docker cp src=/home/alan/src/websites/alanlivio.github.io/. dst=/home/alan/src/websites/alanlivio.github.io
[deploy-hugo-to-ghpages/build]   ✅  Success - Main Checkout
[deploy-hugo-to-ghpages/build] ⭐ Run Main Build at devcontainer
[deploy-hugo-to-ghpages/build]   🐳  docker cp src=/home/alan/.cache/act/[email protected]/ dst=/var/run/act/actions/[email protected]/
[deploy-hugo-to-ghpages/build]   🐳  docker exec cmd=[node /var/run/act/actions/[email protected]/github-action/run-main.js] user= workdir=
| Starting...
[deploy-hugo-to-ghpages/build]   ❗  ::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.
[deploy-hugo-to-ghpages/build]   ❌  Failure - Main Build at devcontainer
[deploy-hugo-to-ghpages/build] exitcode '1': failure
[deploy-hugo-to-ghpages/build] 🏁  Job failed
Error: Job 'build' failed
@Mitrajeet-Golsangi
Copy link

Mitrajeet-Golsangi commented Mar 23, 2024

I am also facing the same issue here with the same setup on nektos act and Docker desktop installed.

@chrmarti
Copy link
Collaborator

chrmarti commented Mar 26, 2024

Make sure Docker is indeed on the PATH at the time the action runs. Maybe run a script step with echo $PATH and docker version right before the action step to check.

@chrmarti chrmarti self-assigned this Mar 26, 2024
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants