Skip to content

Commit

Permalink
Add dockerfile-json
Browse files Browse the repository at this point in the history
This tool reads a Dockerfile and spits out the corresponding JSON
representation (using the official parser code).

Signed-off-by: Marcelo E. Magallon <[email protected]>
  • Loading branch information
mem committed Mar 13, 2024
1 parent 4a8cb63 commit 69efd62
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ FROM go as tools
# Add bingo
RUN env GOBIN=/build go install github.com/bwplotka/[email protected]

# Add dockerfile-json
RUN git clone --depth 1 --branch 1.0.8 https://github.com/keilerkonzept/dockerfile-json dockerfile-json && \
cd dockerfile-json && \
env GOBIN=/build go install .

# Add enumer
RUN env GOBIN=/build go install github.com/dmarkham/[email protected]

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ FROM go as tools
# Add bingo
RUN env GOBIN=/build go install {{ .data.bingo.repo }}@{{ .data.bingo.version }}

# Add dockerfile-json
RUN git clone --depth 1 --branch {{ index .data "dockerfile-json" "version" }} https://{{ index .data "dockerfile-json" "repo" }} dockerfile-json && \
cd dockerfile-json && \
env GOBIN=/build go install .

# Add enumer
RUN env GOBIN=/build go install {{ .data.enumer.repo }}@{{ .data.enumer.version }}

Expand Down
3 changes: 3 additions & 0 deletions lib/image-test
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ wire help
echo '=== bingo'
bingo version

echo '=== dockerfile-json'
dockerfile-json -help

echo '=== enumer'
enumer -help

Expand Down
4 changes: 4 additions & 0 deletions versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ buf:
repo: github.com/bufbuild/buf
version: v1.30.0
type: go
dockerfile-json:
repo: github.com/keilerkonzept/dockerfile-json
version: 1.0.8
type: go
enumer:
repo: github.com/dmarkham/enumer
version: v1.5.9
Expand Down

0 comments on commit 69efd62

Please sign in to comment.