0

I tried to generate swagger using this command swagger generate spec -o ./swagger.yaml --scan-models

but I got error like this :

open ./swagger.yaml: permission denied

I have installed (go-swagger) using docker with version :

version: v0.30.4
commit: df6da9b77aa9751f06bedb17fcf92b1ab67a7a47

and use following command to run the docker

alias swagger='docker run --rm -it  --user $(id -u):$(id -g) -e GOCACHE=/tmp -e GOPATH=$(go env GOPATH):/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger'

Thanks for any help!!

noqriz
  • 11
  • 1
  • 2
    You're running this command within the Container? If so, make sure you have a [volume mapping](https://docs.docker.com/storage/bind-mounts/) defined which allows the container to access your filesystem if the `swagger.yaml` file is on your host system or copy the `swagger.yaml` to the correct location within your container. – Mushroomator Jan 24 '23 at 10:58
  • I already edit the question, please have take a look, I think I already add volume mapping while running the docker. – noqriz Jan 25 '23 at 02:59

0 Answers0