Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marwan-at-work/dfparser
Naive Dockerfile Parser
https://github.com/marwan-at-work/dfparser
Last synced: 6 days ago
JSON representation
Naive Dockerfile Parser
- Host: GitHub
- URL: https://github.com/marwan-at-work/dfparser
- Owner: marwan-at-work
- Created: 2017-04-07T22:57:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-09T18:43:14.000Z (over 7 years ago)
- Last Synced: 2024-08-01T13:29:09.346Z (3 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerfile Parser
If you simply want to input a docker file and read its commands.
`go get github.com/marwan-at-work/dfparser`
### Usage
```go
import (
"github.com/marwan-at-work/dfparser"
"fmt"
)func main() {
f, err := os.Open("./Dockerfile")
if err != nil {
panic(err)
}
defer f.Close()d, err := dfparser.Parse(f) // handleErr
if err != nil {
panic(err)
}fmt.Println("from:", d.From, "workdir:", d.Workdir)
}
```