Skip to content

Commit

Permalink
Dockerfile changes (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Gibler authored Apr 28, 2024
1 parent 5575302 commit 601e141
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM cgr.dev/chainguard/wolfi-base as build

USER root

RUN apk update \
&& apk add --no-cache make go

WORKDIR /deepwalk

COPY . .

RUN CGO_ENABLED=0 go build -o deepwalk . && chmod +x deepwalk

FROM cgr.dev/chainguard/static

COPY --from=build /deepwalk/deepwalk /deepwalk

ENTRYPOINT ["/deepwalk"]
CMD ["--help"]
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ import (
)
```

Or, use the provided Dockerfile:
```
make build-wolfi
```

then:
```
docker run deepwalk:latest
```

## Examples

The original use-case for this in Python was to traverse Python dictionaries. While Golang has different names and conventions for this, the approach remains the same.
Expand Down Expand Up @@ -282,6 +292,25 @@ To cut a release for this package, do the following:
- Run `git push origin --tags`
- Create a new release using the new tag
### Dockerfile Scan
0 CVEs c/o Wolfi:
```
❯ grype deepwalk:latest
✔ Vulnerability DB [no update available]
✔ Loaded image deepwalk:latest
✔ Parsed image sha256:15776b55889a5e6500937a6ee1d9c8b0c5f6dea8f2e9631e324f27fa48a7077c
✔ Cataloged contents a89b0db2a340569633d593f81c58297e103de4b8ca80f97459ed5678809c4f24
├── ✔ Packages [14 packages]
├── ✔ File digests [397 files]
├── ✔ File metadata [397 locations]
└── ✔ Executables [1 executables]
✔ Scanned for vulnerabilities [0 vulnerability matches]
├── by severity: 0 critical, 0 high, 0 medium, 0 low, 0 negligible
└── by status: 0 fixed, 0 not-fixed, 0 ignored
No vulnerabilities found
```
## Acknowledgements
[wk8](https://github.com/wk8) for their extremely handy [go-ordered-map](https://pkg.go.dev/github.com/wk8/go-ordered-map/v2@v2.1.8) package
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
go build -race -o deepwalk .

build-docker:
docker buildx build -f Dockerfile.wolfi . --load
docker buildx build -f Dockerfile . --load -t deepwalk:latest

clean-mod:
go clean -modcache
Expand Down

0 comments on commit 601e141

Please sign in to comment.