28mm / blast-radius

Interactive visualizations of Terraform dependency graphs using d3.js
https://28mm.github.io/blast-radius-docs/
MIT License
2.04k stars 257 forks source link

Getting chmod: cannot access #52

Closed amanbabbar-kipl closed 5 years ago

amanbabbar-kipl commented 5 years ago

i download the zip code and extract. put one *.tf file in same directory. after running the below command, i got error mentioned below: command:

docker build -t blast-radius - < Dockerfile

error:

chmod: cannot access './docker-build.sh': No such file or directory
28mm commented 5 years ago

@kiplphp38 are you trying to build the docker image, or run it? I would not place terraform files in the blast-radius source directory, as it doesn't look for them at build time.

To build the image:

docker build -t blast-radius .

To run it, change to the project directory, and run:

docker run --cap-add=SYS_ADMIN -it --rm -p 5000:5000 -v $(pwd):/workdir:ro 28mm/blast-radius

Hope that helps!

amanbabbar-kipl commented 5 years ago

@28mm I successfully build the image but got another error To build the image:

docker build -t blast-radius .

To run it in the same directory having *.tf files with modules. i got error

/src/docker-entrypoint.sh: line 14: cd: /workdir-rw: No such file or directory

then i update /workdir to /workdir-rw in the below command

docker run --cap-add=SYS_ADMIN -it --rm -p 5000:5000 -v $(pwd):/workdir-rw:ro 28mm/blast-radius

after that i got error:

Error loading modules: error downloading 'file:///workdir-rw/modules/vpc': remove .terraform/modules/9bf8ac2d543bbd59da3f80f814aabc34: read-only file system
28mm commented 5 years ago

@kiplphp38

It's not obvious to me why docker-entrypoint.sh would fail to cd to /workdir-rw, since it creates it several earlier, and is running with set -e

It might be worth starting from scratch, here, beginning with deleting any existing images.

docker rmi blast-radius
docker rmi 28mm/blast-radius

Now clone the repo and rebuild the image

git clone https://github.com/28mm/blast-radius.git \
&& cd blast-radius \
&& docker build -t blast-radius .

And finally execute

docker run --cap-add=SYS_ADMIN -it --rm -p 5000:5000 -v $(pwd):/workdir:ro blast-radius