Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from jessfraz:master #4

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 16, 2019

See Commits and Changes for more details.


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

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