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

[Docker] EISDIR: illegal operation on a directory, read #378

Open
ReganRyanNZ opened this issue Dec 17, 2019 · 2 comments
Open

[Docker] EISDIR: illegal operation on a directory, read #378

ReganRyanNZ opened this issue Dec 17, 2019 · 2 comments

Comments

@ReganRyanNZ
Copy link

Detailed description

I am trying to run this line in gitlab ci:

docker run -v $(pwd)/crewmeister.yaml:/crewmeister.yaml wework/speccy lint /crewmeister.yaml

And it crashes with these logs:

Running with gitlab-runner 12.3.0 (a8a019e0)
  on Hetzner Cloud 195.201.134.35 gWew9yjP
Using Docker executor with image docker ...
Pulling docker image docker ...
Using docker image sha256:8e347affc72a211a0fa374a5a4b0cacc9bcdf83c3dedbceb971ea41f82d29eb1 for docker ...
Running on runner-gWew9yjP-project-33-concurrent-0 via gitlab-runner...
Fetching changes...
Reinitialized existing Git repository in /builds/crewmeister/api/.git/
Checking out 31fc7fa4 as master...

Skipping Git submodules setup
$ docker run -v $(pwd)/crewmeister.yaml:/crewmeister.yaml wework/speccy lint /crewmeister.yaml
Could not open file: EISDIR: illegal operation on a directory, read
ERROR: Job failed: exit code 1

I have tried:

  • Specifying a speccy version
  • Mounting the volume under /project
  • Using .yml instead of .yaml
  • Using absolute paths instead of $(pwd)

And none of the above have changed the error.

Is there any way to fix this? Or even just get more information? What file is it trying to read?

@m-idler
Copy link

m-idler commented Feb 5, 2020

I guess you are missing the /project part in the target, for me it works like this:

docker run -v $(PWD)/openapi.yml:/project/openapi.yml wework/speccy lint openapi.yml

@Skeeve
Copy link

Skeeve commented Sep 20, 2024

Same error here.

The issue was: -v seems to expect an abolute path.

My solution to the "issue" is to have a bash wraper, so that I can call it with speccy MySpec.yaml

#!/bin/bash -e

dir="$( dirname "$1" )"
name="$( basename "$1" )"
cd "$dir"

docker run \
  -v "$PWD/$name":/project/"$name" \
  wework/speccy lint "$name"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants