Skip to content

Commit

Permalink
Dockerfile: Fixed the 'ENTRYPOINT' as it needed the ./ prefix
Browse files Browse the repository at this point in the history
Also added entry to the CHANGELOG and updated the README with this new feature
  • Loading branch information
xescugc committed Aug 28, 2023
1 parent 059cef0 commit 07eccd2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- New flag `--description-file` to generate a description file of the Graph Nodes
([Issue #178](https://github.com/cycloidio/inframap/issues/178))
- `graphviz` is now in the Docker image so no need of external tools to generate the graph by @agalazis
([PR #221](https://github.com/cycloidio/inframap/pull/221))

### Changed

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apk -q --no-progress add git make \

FROM alpine

RUN apk -q --no-progress add graphviz ttf-dejavu\
RUN apk -q --no-progress add graphviz ttf-dejavu \
&& addgroup -g 1000 inframap \
&& adduser -u 1000 -G inframap -s /bin/ash -D inframap

Expand All @@ -22,4 +22,4 @@ WORKDIR /home/inframap

COPY --from=builder /app/inframap /home/inframap

ENTRYPOINT ["inframap"]
ENTRYPOINT ["./inframap"]
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,41 @@ The most important subcommands are:
Visualizing with [dot](https://graphviz.org/download/)

```shell
$ inframap generate state.tfstate | dot -Tpng > graph.png
inframap generate state.tfstate | dot -Tpng > graph.png
```

or from the terminal itself with [graph-easy](https://github.com/ironcamel/Graph-Easy)

```shell
$ inframap generate state.tfstate | graph-easy
inframap generate state.tfstate | graph-easy
```

or from HCL

```shell
$ inframap generate config.tf | graph-easy
inframap generate config.tf | graph-easy
```

or HCL module

```shell
$ inframap generate ./my-module/ | graph-easy
inframap generate ./my-module/ | graph-easy
```

using docker image (assuming that your Terraform files are in the working directory)

```shell
$ docker run --rm -v ${PWD}:/opt cycloid/inframap generate /opt/terraform.tfstate
docker run --rm -v ${PWD}:/opt cycloid/inframap generate /opt/terraform.tfstate
```

or if you use docker and want to have the images generated already, the docker image has the `graphviz` lib installed:

```shell
docker run --rm -v ${PWD}:/opt --entrypoint "/bin/ash" inframap -c './inframap generate /opt/PATH_TO_HCL_STATE | dot -Tpng > /opt/graph.png'
```

and the generated image will be on `$PWD/graph.png`


**Note:** InfraMap will guess the type of the input (HCL or TFState) by validating if it's a JSON and if it fails then we fallback
to HCL (except if you send a directory on args, the it'll use HCL directly), to force one specific type you can use `--hcl` or `--tfstate` flags.
Expand Down

0 comments on commit 07eccd2

Please # to comment.