Skip to content

Commit a025f54

Browse files
authored
Merge pull request #38 from nvtkaszpir/dockerfile-workdir
Add workdir to Dockerfile to allow mounting charts, expand docs
2 parents effae03 + 1d599a9 commit a025f54

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
FROM alpine
1+
FROM alpine:3.11.5
22

33
COPY helm-docs /usr/bin/
44

5+
WORKDIR /helm-docs
6+
57
ENTRYPOINT ["helm-docs"]

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If no template file is provided, the tool has a default internal template that w
1414
## Installation
1515
helm-docs can be installed using [homebrew](https://brew.sh/):
1616

17-
```
17+
```bash
1818
brew install norwoodj/tap/helm-docs
1919
```
2020

@@ -23,13 +23,16 @@ of the tool.
2323

2424
To build from source in this repository:
2525

26-
```
26+
```bash
2727
cd cmd/helm-docs
2828
go build
2929
```
3030

3131

3232
## Usage
33+
34+
## Using binary directly
35+
3336
To run and generate documentation into READMEs for all helm charts within or recursively contained by a directory:
3437

3538
```bash
@@ -41,6 +44,37 @@ helm-docs --dry-run # prints generated documentation to stdout rather than modif
4144
The tool searches recursively through subdirectories of the current directory for `Chart.yaml` files and generates documentation
4245
for every chart that it finds.
4346

47+
## Using docker
48+
49+
You can mount directory with charts under `/helm-docs` within container.
50+
51+
Print generated documentation to stdout rather than modifying READMEs:
52+
53+
```bash
54+
docker run -v "$(pwd):/helm-docs" jnorwood/helm-docs:latest --dry-run
55+
```
56+
57+
Overwrite READMEs within mounted directory:
58+
59+
```bash
60+
docker run -v "$(pwd):/helm-docs" jnorwood/helm-docs:latest
61+
```
62+
63+
Notice: You may need to fix permissions to the created files.
64+
65+
66+
# Building from source
67+
68+
Notice that you need to have build chain toolkit for given platform and golang installed.
69+
Next you may need to export some vars to build standalone, non-linked binary for given platform and architecture:
70+
71+
```bash
72+
export CGO_ENABLED=0 GOOS=linux GOARCH=amd64
73+
make clean
74+
make fmt
75+
make test
76+
make
77+
```
4478

4579
## Available Templates
4680
The templates generated by the tool are shown below, and can be included in your `README.md.gotmpl` file like so:

0 commit comments

Comments
 (0)