Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Sep 16, 2019

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ilyar and others added 12 commits September 16, 2019 14:25
This change will allow a user to parse the stages from a dockerfile. It interpolates a stage name if none is specified.
* feat: allow outputting the workdir(s) for one or more Dockerfiles

This command is useful in inspection of Dockerfiles, and can be used to intelligently push/pull built files from a docker image. It also allows disabling of ranking, such that the the workdirs are output in order of appearance.

For instance, if a build tool expects to pull a config file from a container and has access to the respective Dockerfile, it can do something like:

```shell
WORKDIR=$(dockfmt workdir --no-rank --skip-header path/to/Dockerfile | tail -n1)
[[ -z "$WORKDIR" ]] && WORKDIR="/app"
docker cp "container-name:$WORKDIR/nginx.conf.template" nginx.conf || true
```

In this way, we can pull a file from a container at the best path possible - either a specified WORKDIR or a sane default.

* fix: correct lint errors

* chore: drop skip-header

This should be in a separate PR anyhow.
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
* Refactor forFile() to pass *os.File

* Refactor forFile() to extract forFile1()

* Read from stdin if no dockerfiles given

* Use strings.EqualFold()

Suggested by static checker

* Update usage messages for stdin support
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
@pull pull bot added the ⤵️ pull label Sep 16, 2019
@pull pull bot added merge-conflict Resolve conflicts manually and removed size/XXL labels Feb 19, 2020
Signed-off-by: Jess Frazelle <[email protected]>
github-actions bot and others added 5 commits September 17, 2020 21:01
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
Signed-off-by: Jess Frazelle <[email protected]>
@pull pull bot removed the size/XXL label Sep 18, 2020
@pull pull bot removed the size/XXL label Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants