Commit Graph

25 Commits

Author SHA1 Message Date
Daniel J Walsh e0ca332f1d
Add more support for removing config
Currently we can remove configuration data in buildah config
by adding a trailing "-". This PR adds support for this in --port
calls.  Also added support for clearing all config for a specified
option, if the user specifies "-".

Currently the code blocks setting ANNOTATIONS and LABELS without a
value.  This is broken and should be allowed.

Similarly we were not expaning envioronment variables from the host when
they were not set.

podman run --env foobar
is valid,
so
buildah config --env foobar
should also be valid.

Fixes: https://github.com/containers/buildah/issues/2859

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-12 12:42:09 -05:00
Ed Santiago 6c1494c530 New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.

The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:

  * Making 'bud' the default output of 'buildah help',
    with 'build-using-dockerfile' as an alias. This is
    the inverse of the situation until now: buildah
    would list build-using-dockerfile as the primary
    name. The man page, OTOH, lists 'bud'. The source
    file name is 'bud'. I suspect that most people
    type 'bud'. So, for consistency, I choose to make
    'bud' the default visible command.

  * add --encryption-key and --encrypt-layer documentation
    to buildah-commit.md, and --encrypt-layer to -push.md.
    Please double-check the wording here.

  * remove --notruncate from buildah-images.md. The option
    does not exist (although there is a TODO comment in
    the code). If it should exist, it is left to the
    reader to implement. I would humbly suggest that this
    is a good idea, for consistency with buildah containers.

  * remove --shm-size from buildah-pull.md. The option
    does not exist, and I suspect this was a copy-paste error.

  * remove --security-opt from run.go. It was unimplemented
    and undocumented.

  * remove --userns-[gu]id-map from buildah-bud.md. These
    are global options, not bud options, and are documented
    well enough in buildah.bud.

Trivial (IMO) changes:

  * split options in man pages, from '**--foo, -f**'
    to '**--foo**, **-f**'. This conforms with the style
    used in podman man pages.

  * add missing one-letter aliases (usually "-q", "-a")

  * add missing man page entries for some easy options

  * sort out-of-order subcommand listings in man pages

Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-01 04:55:24 -06:00
Ashley Cui 03aa80716f Bug fix for volume minus syntax
Do not check disk for existence of volume.
If volume that ends with `-` is set in config, remove it.
If not, add it into config.

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>

Closes: #1767
Approved by: rhatdan
2019-08-07 15:11:05 +00:00
Ashley Cui 677b771195 Add '-' minus syntax for removal of config values
Minus syntax for `--env`, `--label`, and `-annotation` flags for `buildah config` subcommand.

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>

Closes: #1748
Approved by: rhatdan
2019-07-31 11:23:49 +00:00
Ashley Cui 4ccb343cef Added '-' syntax to remove volume config option
When using the --volume flag, ojects ending in "-" are checked if they exist on disk. If they exist on disk they are added as a volume. Otherwise, if the volume is already config'd, that volume is removed

examples:
if /testvol exists:
"--volume /testvol-" removes /testvol from the config.

if /testvol- exists:
"--volume /testvol-" adds /testvol- from the config.

Signed-off-by: Ashley Cui <ashleycui16@gmail.com>

Closes: #1670
Approved by: rhatdan
2019-07-29 19:04:34 +00:00
Nalin Dahyabhai 40d4d599c6 healthcheck start-period: update documentation
A re-reading of the spec doesn't agree with our docs - the healthcheck
start period isn't a delay in the first invocation of the healthcheck
command, but is instead a grace period where failures aren't counted as
indications of problems.  Instead, during that grace period, failures
are attributed to the container not yet having finished starting.  Once
the healthcheck command succeeds, the engine should start counting
failures.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1338
Approved by: rhatdan
2019-02-14 23:53:44 +00:00
Silvio Tomatis 711f9ea264 Fix example for setting multiple environment variables
On version `1.6-dev` the current example yields:
```
too many arguments specified
```

Signed-off-by: Silvio Tomatis <silviot@gmail.com>

Closes: #1327
Approved by: rhatdan
2019-02-09 15:35:58 +00:00
Nalin Dahyabhai 23ed59594b Add options for empty-layer history entries
Add configuration methods for adding entries which will show up in a
committed image's history, both before and after the new layer that we
add while committing the image.  Expose them from the CLI in the form of
a new --add-history option for the "add", "config", "copy", and "run"
commands.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1300
Approved by: rhatdan
2019-01-21 19:11:21 +00:00
Nalin Dahyabhai b2e43c7d6d Support HEALTHCHECK
Handle healthcheck configuration that imagebuilder picks up, and add CLI
flags to `buildah config` that allow the values to be set on the command
line.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #943
Approved by: TomSweeneyRedHat
2018-11-21 12:56:24 +00:00
Daniel J Walsh a1d7dca14b
Fix the the in buildah-config man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-08-02 09:26:55 -04:00
W. Trevor King a9c12065b3 docs: Follow man-pages(7) suggestions for SYNOPSIS
man-pages(7) has [1]:

> For commands, this shows the syntax of the command and its arguments
> (including options); boldface is used for as-is text and italics are
> used to indicate replaceable arguments. Brackets ([]) surround
> optional arguments, vertical bars (|) separate choices, and ellipses
> (...) can be repeated.

I've adjusted our SYNOPSIS entries to match that formatting, and
generally tried to make them more consistent with the precedent set by
the man-pages project.  Outside of the SYNOPSIS entry, I prefer using
backticks for literals, although in some places I've left the **
bolding to keep things visually similar to a nearby SYNOPSIS entry.

I've also simplified a few placeholders, e.g. "containerID" ->
"container", because I didn't think the additional bit was providing
much additional context.  If there is ambiguity about the
representation, it should be addressed in the DESCRIPTION instead of
with an "ID" or "Name" suffix.

[1]: http://man7.org/linux/man-pages/man7/man-pages.7.html

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #839
Approved by: rhatdan
2018-06-30 10:31:06 +00:00
pixdrift fbc03e67b0 Minor update to buildah config documentation for entrypoint
Signed-off-by: pixdrift <support@pixeldrift.net>

Closes: #771
Approved by: rhatdan
2018-06-10 20:23:28 +00:00
Daniel J Walsh 074a498ec0 Print Warning message if cmd will not be used based on entrypoint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #741
Approved by: TomSweeneyRedHat
2018-06-08 13:38:54 +00:00
Daniel J Walsh b66e853145 Add OnBuild support for Dockerfiles
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #722
Approved by: mheon
2018-05-31 13:30:29 +00:00
Nalin Dahyabhai 0afa60eb05 Add CLI options for specifying namespace and cgroup setup
Add options to the CLI that specify which cgroups we execute "run"
commands under, and controlling how we set up namespaces for them.
Pass them down to Builders that we create, and allow them to be
overridden by options passed to Builder.Run().

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #700
Approved by: rhatdan
2018-05-24 14:10:01 +00:00
Nalin Dahyabhai 523b1095d8 Add config --comment/--domainname/--history-comment/--hostname
Add options to "buildah config" for setting comment, domainname, and
hostname configuration bits, and the comment in history items which
describe layers that we add, and tests for them.  Add a test for the
--shell option while we're at it.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #641
Approved by: rhatdan
2018-04-27 16:33:13 +00:00
Nalin Dahyabhai c3c6cb2cbd 'buildah config': stop replacing Created-By whenever it's not specified
The CLI shouldn't have had a default here, which made us treat it as if
it had been specified every time, potentially overwriting a value that
had previously been explicitly set.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #641
Approved by: rhatdan
2018-04-27 16:33:13 +00:00
Daniel J Walsh ca1704fcbb Modify man pages so they compile correctly in mandb
This fixes an issue where if you did
man -k buildah-bud

buildah-bud (1)    - (unknown subject)

Now you will see

man -k buildah-bud
buildah-bud (1)      - Build an image using instructions from Dockerfiles.

More importantly
man -k Dockerfile
buildah-bud (1)      - Build an image using instructions from Dockerfiles.
docker-build (1)     - Build an image from a Dockerfile
docker-image-build (1) - Build an image from a Dockerfile
Dockerfile (5)       - automate the steps of creating a Docker image
podman-build (1)     - Build a container image using a Dockerfile.

Will now list buildah-d

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #638
Approved by: TomSweeneyRedHat
2018-04-26 17:16:23 +00:00
Daniel J Walsh e008b736ac Clarify the use of buildah config options
Make it clearer to the user which options can be executed
multiple times, versus those that can only used once.

Cleanup some documentation issues

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #592
Approved by: rhatdan

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #602
Approved by: pixdrift
2018-04-19 10:42:45 +00:00
Daniel J Walsh 2015cde90c Clarify the use of buildah config options
Make it clearer to the user which options can be executed
multiple times, versus those that can only used once.

Cleanup some documentation issues

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #592
Approved by: rhatdan
2018-04-17 18:35:40 +00:00
Zhou Hao f2c532a958 config: add support for StopSignal
Add a stop-singnal option for buildah-config.

Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>

Closes: #567
Approved by: rhatdan
2018-04-12 06:58:26 +00:00
Daniel J Walsh 5ce80091ba Add support for shell
Also vendor in the latest imagebuilder code and all the packages
that come with it.

Note: imagebuilder.NewBuilderForReader has been removed from imagebuilder
so I had to split the function up into two different calls.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #517
Approved by: rhatdan
2018-04-03 22:25:56 +00:00
Daniel J Walsh 604fdb0de1 Fix man pages to format correctly
I noticed when you look at the man pages with man ./doc/buildah.1 that the
headings were not showing up.  go-md2man wanted to have a primary header
in order to format them correctly.  Removing the first # from the first line
fixes the issue.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #521
Approved by: rhatdan
2018-03-23 14:06:29 +00:00
Nalin Dahyabhai aff92e565c Miscellaneous man page updates
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #67
Approved by: rhatdan
2017-04-14 10:12:01 +00:00
TomSweeneyRedHat 2fe578c82f Create manpages for the buildah project
Second pass of manpages, more tweaking to follow.

Signed-off-by: TomSweeneyRedHat <tsweney@redhat.com>

Closes: #53
Approved by: nalind
2017-04-11 17:22:37 +00:00