Commit Graph

268 Commits

Author SHA1 Message Date
OpenShift Merge Robot 06d974b700
Merge pull request #3004 from jmguzik/support-for-chmod-flag-add-and-copy
Chmod flag for add and copy
2021-02-24 09:35:22 -05:00
OpenShift Merge Robot b51f63a3b6
Merge pull request #3036 from rhatdan/version
Make sure we set the buildah version label
2021-02-24 09:28:21 -05:00
Jakub Guzik d0917fa7e6 buildah add/copy --chmod dockerfile implementation
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-02-24 08:40:04 +01:00
Daniel J Walsh 3b954c2989
Make sure we set the buildah version label
Currently if the buildah image has a label that was built with
an older version of buildah, we don't update to the latest version.

This PR Will cause the new version to use the current label.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-23 16:31:25 -05:00
caiges 8a5447968b
Fix reaping of stages with no instructions
Signed-off-by: caiges <caigesn@gmail.com>
2021-02-19 23:28:48 -07:00
Ashley 021ae2f64a
Merge branch 'master' into history 2021-02-16 16:02:40 -05:00
Diego b870be611d Add base image name to comment
Add the name of the base image being used by the build
in the comments of the first layer created.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-02-15 16:31:41 -05:00
TomSweeneyRedHat 758eb20144 Don't fail copy to emptydir
When a COPY command was being targeted at an empty new directory,
the copy would fail.  It could be "worked around" by putting a dummy
file into the directory.

Addresses:  #2964
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-02-14 14:24:34 -05:00
Daniel J Walsh 811822eb54
Revert patch to allow COPY/ADD of empty dirs.
This Patch breaks conformance with Docker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-12 10:24:45 -05:00
TomSweeneyRedHat 3679b9f7ec Don't fail copy to emptydir
When a COPY command was being targeted at an empty new directory,
the copy would fail.  It could be "worked around" by putting a dummy
file into the directory.

Addresses:  #2964
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-02-10 19:11:46 -05:00
Antonio Terceiro ab8e351c60 Fix caching layers with build args
This fixes a regression introduced in
9b299588c0.

ib.Run() is only really needed in the ARG step. On all the other steps,
it can cause potentially expensive commands to be executed unecessarily.

Closes https://github.com/containers/buildah/issues/2992

Signed-off-by: Antonio Terceiro <antonio.terceiro@linaro.org>
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-02-10 14:42:22 -03:00
Valentin Rothberg 2301d148da --iidfile: print hash prefix
Prefix the image ID with the hash prefix when using `--iidfile` to be
compatible with Docker.  The absence of the hash can cause
docker-compose to error out.

Reported-in: github.com/containers/podman/issues/9260
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-08 12:24:56 +01:00
Daniel J Walsh 5b350b9a3f
Finish plumbing for buildah bud --manifest
Buildah bud --manifest XYZ was not working.

The manifest was never created. This PR Finishes
the plumbing and allows users to create a manifest
while building an image in one single command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-05 12:36:48 -05:00
Urvashi Mohnani 9b299588c0 Rebuild layer if a change in ARG is detected
Check whether the ARG in the containerfile is changed by
either the --build-arg flag or local environment and use
the cached layer or rebuild the layer accordingly.
Add tests for this use case as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-01-28 08:29:19 -05:00
Urvashi Mohnani 32661c7112 Use build-arg ENV val from local environment if set
If a user sets the ENV to be used with the build-arg flag in
the local environment by exporting it, look it up and use the
value set there for that ENV.
Add tests to cover this use case as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-01-25 09:14:57 -05:00
Chris Evich abf3f0d554
Fix bud capabilities test
This test fails after updating to new VM images which include
https://github.com/containers/common/pull/319

Work around the problem by adding in the capabilities expected
to be present.  Thanks to @edsantiago and @giuseppe for the fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-12 16:26:43 -05:00
Daniel J Walsh 7d9b57e9e1
Use --arch and --os and --variant options to select architecture and os
Remove --override-os and --override-arch flags.

Also use --platform option if specified when generating the SystemContext.
Conflict --platform option with --os, --arch and --variant options.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-06 06:43:13 -05:00
OpenShift Merge Robot ffef8a6c0b
Merge pull request #2864 from jsoref/spelling
Spelling
2020-12-23 17:04:31 +01:00
Daniel J Walsh dc57eea023
Allow users to specify stdin into containers
Some commands within a Containerfile, might need input from users.
For example confirmation commands from Apt.

Adding a --stdin flag will allows users to interact with containers
while running inside of buildah bud.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-22 05:26:57 -05:00
Josh Soref c7963db369 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-21 16:47:18 -05:00
TomSweeneyRedHat 7724292a4d Allow FROM to be overriden with from option
These changes will allow the "FROM" statement in a Containerfile
to be overridden with a new `--from` option.  If I have this Dockerfile.fedora

```
FROM fedora
```

This command will instead build an alpine image:

```
STEP 1: FROM alpine
Completed short name "alpine" with unqualified-search registries (origin: /etc/containers/registries.conf)
Getting image source signatures
Copying blob 188c0c94c7c5 done
Copying config d6e46aa247 done
Writing manifest to image destination
Storing signatures
STEP 2: COMMIT tom
--> d6e46aa2470
d6e46aa2470df1d32034c6707c8041158b652f38d2a9ae3d7ad7e7532d22ebe0
```

Addresses: #2404

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-12-17 19:30:53 -05:00
Daniel J Walsh 0cd2554858
Throw errors when using bogus --network flags
Currently if you give a bogus --network flag,
buildah just ignores it and continues on.

This change will throw proper errors.

Add tests to make sure it works correctly.

Also remove some stuttering to clean up error messages.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-02 10:03:07 -05:00
Daniel J Walsh fde2597af8
Add --ignorefile flag to use alternate .dockerignore flags
Allow users to override location of the .dockerignore file.
If user specified an --ignorefile flag, buildah will read the
file and pass in the exclude lines based on the .dockerignore
contents.

Also add a --contextdir flag to buildah copy and buildah add to
specify where the context directory is located.  For these two
commands the --ignorefile flag requires the --contextdir flag.

When the --ignorefile flag is passed in, the .dockerignore files
in the context directory will be ignored.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-24 15:28:07 -05:00
Nalin Dahyabhai e863665192 imagebuildah: disable pseudo-terminals for RUN
Always handle RUN instructions with no pseudo terminal, which matches
what I see with docker build 19.03.  Interactive 'buildah run' will
still have the same default behavior.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-11-17 11:24:50 -05:00
Valentin Rothberg e1444dd71e short-names aliasing
Add support for short-name aliasing.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-11-13 11:58:48 +01:00
Nikolay Edigaryev d8165d034f test: ensure non-directory in a Dockerfile path is handled correctly
Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
2020-11-10 20:09:28 +03:00
Nalin Dahyabhai a1d4afd16e ADD: handle --chown on URLs
Incorporate the value of the --chown option when digesting content added
from a URL, so that build caching will take it into account.  Add tests
to ensure that layer caching takes into account the changed ownership of
items that we're adding or copying.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-11-05 09:26:15 -05:00
Nalin Dahyabhai 82072d214a imagebuildah: cache should take image format into account
When evaluating cache candidates during a build, only consider an image
if it's in the same format that we're attempting to build.  That way, we
won't mistakenly try to use an OCI format image as a cache when we're
attempting to build an image in Docker format because we're using
configuration features specific to that format, but we forgot to specify
the format during a previous attempt.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-10-30 15:03:44 -04:00
Daniel J Walsh 319d9cc0e0
Buildah bud should not use stdin by default
Fixes: https://github.com/containers/podman/issues/8066
Is reporting that buildah is eating stdin.  I don't beleive
we should be using stdin when doing a buildah bud command
unless `buildah bud -` is specified.  After this PR, the
`-` Dockerfile is still handled.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-20 16:28:10 -04:00
Daniel J Walsh 39f4cfb79d
Stop excessive wrapping
Golang built in functions like os.Create and others print the name of
the file system object when they fail.  Wrapping them a second time
with the file system object, makes the error message look like crap
when reported to the user.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 14:03:13 -04:00
Daniel J Walsh 2cf9c8f2b8
Fix up code based on codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-15 16:49:18 -04:00
Daniel J Walsh 65f07b77ea
Merge pull request #2598 from nalind/copier-relative-hardlink
copier.Get(): hard link targets shouldn't be relative paths
2020-09-09 15:22:41 -04:00
Nalin Dahyabhai e2dc7ec6a4 copier.Get(): hard link targets shouldn't be relative paths
When adding a hard link entry to an archive, don't try to make the path
of the link's target name be relative to the link's location in the
filesystem if they're in the same directory, since receivers don't
interpret it that way.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-08 18:09:15 -04:00
Daniel J Walsh 181cf84b85
Pass timestamp down to history lines
Currently we are not setting the timestamp on the history lines.
Even though this does not effect the image timestamp, these lines
should match the other content in the previously created images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-08 16:33:43 -04:00
Ed Santiago 3635b5b741 bud.bats: use absolute paths in newly-added tests
Gating tests run in a temp directory; relative paths (bud/foo/bar)
will pass in CI but cause gating-test failures.

Solution is trivial: always use ${TESTSDIR}/bud/etc

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-08 10:53:47 -06:00
Yiqiao Pu 01acb21a4d tests: Add some tests
Add following tests:
1. bud capabilities test
2. from with non buildah container
3. pull image into a full storage

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2020-09-07 22:50:34 +08:00
Nalin Dahyabhai 3fa4f2bb0c StageExecutor.intermediateImageExists: recognize cached images based on scratch
Update imagebuildah.StageExecutor.intermediateImageExists() to recognize
images based on scratch as viable candidates for cache images when we
ourselves are based on scratch.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-09-02 17:16:24 -04:00
Daniel J Walsh b715fb86ee
Use --timestamp rather then --omit-timestamp
We recieved feedback on the --omit-timestamp that
users would rather specify the timestamp seconds
rather then just use EPOCH.

This PR removes --omit-timestamp from buildah bud
since this has never been released.

We also hide --omit-timestamp from buildah commit
and allow users to continue to use it, but it conflicts
with --timestamp.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 05:23:41 -04:00
Nalin Dahyabhai b263efe70b build-using-dockerfile: add a hidden --log-rusage flag
Add a flag to imagebuildah.BuildOptions that will log timing and i/o
information at each step of the build process, and enable it if we're
given the hidden --log-rusage flag in the CLI.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-25 12:45:43 -04:00
Nalin Dahyabhai 0bfbd3edb7 newTarDigester: zero out timestamps in tar headers
When digesting tar streams, zero out timestamps in headers before
digesting them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-22 13:16:19 -04:00
Nalin Dahyabhai 92fb2ec626 bud.bats: correct .dockerignore integration tests
The "bud with .dockerignore" test shouldn't be able to copy "subdir"
from the build context to the build container when "subdir" is the next
to last item listed in the build context's .dockerignore file, even
though the "!*/sub1* after it might suggest otherwise, for
compatibility.  Add a second Dockerfile which includes every step except
the last one, which we now expect to fail, to ensure that we succeed up
until that point.

The "bud with .dockerignore - 3" test shouldn't expect to be able to
copy "test1.txt" from the build context, when it's the last item
mentioned in the build context's .dockerignore file.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-21 12:34:01 -04:00
Nalin Dahyabhai 3835460c3b Use pipes for copying
Use the copier package to rework how we handle ADD and COPY.

When evaluating cache for content that's being copied/added in, switch
from (digest the data, check for a cache entry, then maybe copy the data
and create the new layer) to (copy the data and create the new layer,
digesting as we go, check for a cache entry, either commit or discard
the new layer).

Use the copier package for ADD, COPY, and for ensuring that a specified
directory exists in the working container's rootfs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-21 12:34:00 -04:00
bors[bot] 69802bcc3e
Merge #2536 #2537 #2538
2536: Avoid feeding run_buildah to pipe r=TomSweeneyRedHat a=edsantiago

The usage 'run_buildah ... | grep' (or pipe whatever) works,
but it's a super bad pattern. Replace all instances of it
with a one-two of 'run_buildah' and 'expect_output'. Some
of these needed a little minor massaging.

Also: 'run_buildah ... || true' -> 'run_buildah 125 ...'.
I don't review all buildah PRs, so this one slipped by me.

Also: clean up trailing whitespace

Digression: why is 'run_buildah | grep' bad? Because:
  - it is inaccurate. run_buildah does 'echo $output',
    but it also emits other output (the buildah command
    itself, and possible expected-status mismatch).
    It is possible that a pipe-grep could trigger
    on one of these.
  - the reason run_buildah emits these things is so
    a human can look at debug output on failure and
    recognize what command was run, what the output
    was. If we pipe-grep, we lose that.
  - it is possible that a pipe-grep will mask
    a failing run_buildah (I'm not sure about this)
  - expect_output is more precise anyway, hence
    makes a better test.

Signed-off-by: Ed Santiago <santiago@redhat.com>

<!--
Thanks for sending a pull request!

Please make sure you've read and understood our contributing guidelines
(https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring
that all your commits are signed with `git commit -s`.
-->

#### What type of PR is this?

<!--
Please label this pull request according to what type of issue you are
addressing, especially if this is a release targeted pull request.

Uncomment only one `/kind <>` line, hit enter to put that in a new line, and
remove leading whitespace from that line:
-->

> /kind api-change
> /kind bug
> /kind cleanup
> /kind deprecation
> /kind design
> /kind documentation
> /kind failing-test 
> /kind feature
> /kind flake
> /kind other

#### What this PR does / why we need it:

#### How to verify it

#### Which issue(s) this PR fixes:

<!--
Automatically closes linked issue when PR is merged.
Uncomment the following comment block and include the issue
number or None on one line.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`.
-->

<!--
Fixes #
or
None
-->

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

<!--
If no, just write `None` in the release-note block below. If yes, a release note
is required: Enter your extended release note in the block below. If the PR
requires additional action from users switching to the new release, include the
string "action required".

For more information on release notes please follow the kubernetes model:
https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note

```



2537: Vendor in containers/storage v1.23.0 r=TomSweeneyRedHat a=rhatdan

Also drop runc vendor back to v1.0.0-rc91 since this vendor
brings in an unreleased version of runtime-spec which breaks runtime-tools

Finally lower version of runtime-spec
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

<!--
Thanks for sending a pull request!

Please make sure you've read and understood our contributing guidelines
(https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring
that all your commits are signed with `git commit -s`.
-->

#### What type of PR is this?

<!--
Please label this pull request according to what type of issue you are
addressing, especially if this is a release targeted pull request.

Uncomment only one `/kind <>` line, hit enter to put that in a new line, and
remove leading whitespace from that line:
-->

> /kind api-change
> /kind bug
> /kind cleanup
> /kind deprecation
> /kind design
> /kind documentation
> /kind failing-test 
> /kind feature
> /kind flake
> /kind other

#### What this PR does / why we need it:

#### How to verify it

#### Which issue(s) this PR fixes:

<!--
Automatically closes linked issue when PR is merged.
Uncomment the following comment block and include the issue
number or None on one line.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`.
-->

<!--
Fixes #
or
None
-->

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

<!--
If no, just write `None` in the release-note block below. If yes, a release note
is required: Enter your extended release note in the block below. If the PR
requires additional action from users switching to the new release, include the
string "action required".

For more information on release notes please follow the kubernetes model:
https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note

```



2538: conformance testing: ignore buildah.BuilderIdentityAnnotation labels r=TomSweeneyRedHat a=nalind

#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

Ignore the buildah.BuilderIdentityAnnotation label when comparing images that we build with images built using other tools, which of course don't automatically set that label.

#### How to verify it:

Conformance tests should now account for #2510.

#### Which issue(s) this PR fixes:

None

#### Special notes for your reviewer:

The conformance tests don't all pass even with this change; that's ongoing work.

#### Does this PR introduce a user-facing change?

```
None
```

Co-authored-by: Ed Santiago <santiago@redhat.com>
Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Co-authored-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-12 18:00:52 +00:00
Ed Santiago 0693b164cb Avoid feeding run_buildah to pipe
The usage 'run_buildah ... | grep' (or pipe whatever) works,
but it's a super bad pattern. Replace all instances of it
with a one-two of 'run_buildah' and 'expect_output'. Some
of these needed a little minor massaging.

Also: 'run_buildah ... || true' -> 'run_buildah 125 ...'.
I don't review all buildah PRs, so this one slipped by me.

Also: clean up trailing whitespace

Digression: why is 'run_buildah | grep' bad? Because:
  - it is inaccurate. run_buildah does 'echo $output',
    but it also emits other output (the buildah command
    itself, and possible expected-status mismatch).
    It is possible that a pipe-grep could trigger
    on one of these.
  - the reason run_buildah emits these things is so
    a human can look at debug output on failure and
    recognize what command was run, what the output
    was. If we pipe-grep, we lose that.
  - it is possible that a pipe-grep will mask
    a failing run_buildah (I'm not sure about this)
  - expect_output is more precise anyway, hence
    makes a better test.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-11 15:01:26 -06:00
Daniel J Walsh 8bb100be2a
Add --omit-timestamp flag to buildah bud
Currently you can only do deterministic builds with commit command
this change will cause the metadata in the container image to be
epoch 0.

Next step is to save the data in the tar balls as 0.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-11 05:28:41 -04:00
TomSweeneyRedHat 44614d9fe8 Handle COPY --from when an argument is used
When an argument was passed into "COPY --from" command in
a Containerfile like

COPY --from=${toolchainname}

The argument was never resolved to the value that it had been
set to.

Addresses: #2496

It may also address #2404 but I've not yet tested.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-08-10 15:34:48 -04:00
Daniel J Walsh 2c6b0da4d8
Add BuilderIdentityAnnotation to identify buildah version
Users want an annotation embeded in the image identifying the
version of the tool used to build the images.

We were adding this for buildah commit but not for buildah bud.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-06 06:35:58 -04:00
dependabot-preview[bot] 9fb931ca7a
Bump github.com/containers/common from 0.14.0 to 0.15.2
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.14.0 to 0.15.2.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.14.0...v0.15.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-08 05:23:48 -04:00
bors[bot] 51092ec692
Merge #2418
2418: buildah, bud: support --jobs=N for parallel execution r=rhatdan a=giuseppe

<!--
Please label this pull request according to what type of issue you are
addressing, especially if this is a release targeted pull request.

Uncomment only one `/kind <>` line, hit enter to put that in a new line, and
remove leading whitespace from that line:
-->

/kind feature

#### What this PR does / why we need it:

it enables running multi stages Containerfiles in parallel

#### How to verify it

buildah bud --jobs=$(nproc) .....

#### Which issue(s) this PR fixes:

None


#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
add support for running multi stages Containerfiles in parallel
```



Co-authored-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-01 19:58:30 +00:00
Giuseppe Scrivano 631ecf0562
buildah, bud: support --jobs=N for parallel execution
it enables running multi stages Containerfiles in parallel.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-01 09:34:02 +02:00
TomSweeneyRedHat d29655bf59 Add bud regression tests
We recently made a couple of commits to the imagebuilder
project to address #2345 and #2192.  Tests were created
in that project, but I thought it best to add some
regression tests here in Buildah too.

FYI: @petr-motejlek and @tachoknight

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-06-30 19:30:28 -04:00
Boaz Shuster 1807921d6e Warn on unset build arguments
Display a warning message when there is a building
argument without a default value in the Dockerfile (e.g. "ARG MYVAR")
and no value is set to it using "--build-argument"

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-05-21 18:28:48 +03:00
Brandon Lum 853a35c648 update exit code for tests
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-05-18 21:27:24 +00:00
Brandon Lum 37df2b9690 implementation of encrypt/decrypt push/pull/bud/from
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-05-18 21:27:23 +00:00
Nalin Dahyabhai 0d7d2a0021 imagebuildah: stages shouldn't count as their base images
When initializing a build stage, don't assume that the working container
will be useful for COPY instructions in subsequent stages that reference
the image that we're building FROM.

When locating previously-completed stages referenced in COPY
instructions in later stages, be consistent about requiring that those
stages need to have been completed before we can accept them as
alternate contexts for the sources being copied.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-05-01 12:21:57 -04:00
Daniel J Walsh 2f671a26b2
Return exit code from failed containers
Buildah run was exiting with the correct exit code, when a container
failed.  Buildah bud was not, so this should fix this.

Also switched to the proper exit codes when containers fail.  When
Buildah fails to execute it will exit with a 125 exit code like
Podman does.  If a command fails to execute inside of a container
we will exit with a 126. Currently we do not support the 127 for
exiting when the command does not exist.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 11:24:52 -04:00
Ed Santiago c6e6732c9b dockerignore tests : remove symlinks, rework
rpm 4.16 alpha in rawhide has broken our koji build:

   https://github.com/containers/buildah/issues/2264

   https://github.com/rpm-software-management/rpm/issues/1159

TL;DR we can no longer package the 'circular-symlink' file
used in tests. This PR removes that and other symlinks from
the git working tree, and reworks the test so it runs from
a temporary directory and creates all necessary symlinks.

Also, since the test as written was simply checking "did it
run" without actually testing anything, add a test to confirm
that the files added to the image are exactly what we expect.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-02 10:47:56 -06:00
Ed Santiago 617dc15dbd bud.bats - cleanup, refactoring
Fix three issues identified in #2036:

 - the 'gitrepo and branch' test was pulling from a place
   that took four minutes; change it to our own repo,
   suggested by Dan, which takes just a few seconds.

   -- also, remove what I think is an unnecessary dup.
      If buildah can pull from a branch, it can pull
      from master.

 - the httpd tests were really confusing, with lots of
   copy/pasted code differing in only small ways. Refactor
   to make the purpose of each test more apparent, and
   to make it easier to add new ones as needed.

 - combine bud-http-context-dir-with-Dockerfile -pre and -post,
   since they were identical. (Context: they started off being
   different tests, with command-line options in different
   order, but as of #493 the -post form of options no longer
   works so the -post test is no longer relevant)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-01 09:16:50 -06:00
Nick Carboni 86fa264ac1 Make image history work correctly with new args handling
Previously, every build-arg was recorded in the image history
even if the arg was not accessible to that layer when the build
was run.

This commit fixes that by ensuring that args are only added to
history when they are in scope. This is tracked in the
imagebuilder.Builder struct which is now accessible through
the stage reference in the StageExecutor

Fixes #2210

Signed-off-by: Nick Carboni <ncarboni@redhat.com>
2020-03-26 13:43:49 -04:00
Nick Carboni 7535471ff6 Don't add args to the RUN environment from the Builder
The correct args are already contained in the RunOptions.
They were resolved by the imagebuilder library's Step
(edcddd8483/builder.go (L311-L317))
function

This was previously adding args that should not have been accessible
in the current stage as they were not first referenced by an ARG
command

Signed-off-by: Nick Carboni <ncarboni@redhat.com>
2020-03-26 13:43:49 -04:00
Daniel J Walsh fa21ea4938
Fix .dockerignore with globs and ! commands
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-23 14:31:06 -04:00
Nick Carboni 10e59b5b31 Run stat command directly for volume ownership test
This removes the script previously used which may have been
causing #2235

Signed-off-by: Nick Carboni <ncarboni@redhat.com>
2020-03-19 09:27:55 -04:00
bors[bot] 6e0116ac7c
Merge #2216
2216: Preserve volume uid and gid through subsequent commands r=TomSweeneyRedHat a=carbonin

<!--
Thanks for sending a pull request!

Please make sure you've read and understood our contributing guidelines
(https://github.com/containers/buildah/blob/master/CONTRIBUTING.md) as well as ensuring
that all your commits are signed with `git commit -s`.
-->

#### What type of PR is this?

<!--
Please label this pull request according to what type of issue you are
addressing, especially if this is a release targeted pull request.

Uncomment only one `/kind <>` line, hit enter to put that in a new line, and
remove leading whitespace from that line:
-->

/kind bug


#### What this PR does / why we need it:

This PR pulls the UID and GID fields from the stored file stat when reconstructing a volume after subsequent commands

#### How to verify it
Build the following Dockerfile:
```Dockerfile
FROM centos:8
RUN dnf -y install --setopt=tsflags=nodocs postgresql-server
VOLUME [ "/var/lib/pgsql/data" ]
RUN touch /root/test
```

Observe the output of the following command:
```bash
$ podman run --rm <image> ls -l /var/lib/pgsql
total 0
drwx------. 1 postgres postgres 0 May 31  2019 backups
drwx------. 1 postgres postgres 0 Mar 10 23:37 data
```

#### Which issue(s) this PR fixes:

<!--
Automatically closes linked issue when PR is merged.
Uncomment the following comment block and include the issue
number or None on one line.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`, or `None`.
-->

Fixes #2202

#### Does this PR introduce a user-facing change?
No
<!--
If no, just write `None` in the release-note block below. If yes, a release note
is required: Enter your extended release note in the block below. If the PR
requires additional action from users switching to the new release, include the
string "action required".

For more information on release notes please follow the kubernetes model:
https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note
None
```



Co-authored-by: Nick Carboni <ncarboni@redhat.com>
2020-03-11 17:07:15 +00:00
Nick Carboni 4868cbc2d4 Add tests for volume ownership
Signed-off-by: Nick Carboni <ncarboni@redhat.com>
2020-03-11 09:22:06 -04:00
Daniel J Walsh a9e17e61e5
Fix errors found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-05 13:53:30 -05:00
TomSweeneyRedHat 13dcf6d531 Show error on copied file above context directory in build
When a COPY command in a Container file looked like "../file.txt"
SecureJoin would secure the file by lopping off the "../".
However, the code would then append that file name to the passed in
context directory and look for the file.  That would fail as in most
cases there was no `{context-dir}/file.txt`, rather the file was at
`{context-dir}/../file.txt`.  Using a relative directory like this
outside of the context directory can be a security risk.  Docker
doesn't allow it nor should we.

This change now errors out when a file that starts with `../` is
presented as a copy from target.

Addresses: https://github.com/containers/libpod/issues/5035

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-02-11 11:14:34 -05:00
Ed Santiago f0b79583bf use alpine, not centos, for various tests
Also: images json test: rewrite to actually check for
keys instead of just number of lines. Reason: when using
older podman to prefetch (in f29), 'history' key is lost,
giving us 26 lines of output instead of 30.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-06 14:12:59 -07:00
Ed Santiago 0f5fd98218 Flake handling: cache and prefetch images
Show of hands: who here loves submitting a PR, then coming back
hours later to find one job failed, then spending time poring
over logs and finding a network error? Anyone? Anyone?

This is a lame attempt to minimize such flakes by caching
commonly-used images and restoring them on demand. We
introduce a new helper, _prefetch(), which podman-pulls
an image the first time, podman-saves it, then on
subsequent calls (for the same image) podman-loads it:

    @test foo {
        _prefetch alpine busybox
        ...tests that run buildah-from either
    }

This is an imperfect solution: it is incomplete and will
grow more so over time as new tests are added. It is
difficult to verify its coverage. I'm really unhappy
with it but if it works, the Total Sum Of Unhappiness
might decrease overall thanks to fewer flakes. If it
doesn't work, it's trivial to remove _prefetch calls
using a sed script. Shall we give it a chance?

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-06 08:16:02 -07:00
TomSweeneyRedHat 4131dfa382 Adjust copy destination for linked tar files in ADD
When we are given a linked tar file as a source file, we were setting the
destination to the original destination plus the name of the link.
This created a directory using the links name and then everything was
copied under that directory.  The link name should not be used as part
of the directory structure.

Fixes: #2102

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

Closes: #2112
Approved by: rhatdan
2020-01-29 18:31:21 +00:00
Sascha Grunert 6417a9a074 Allow users to set OS and architecture on bud
When building images we now allow the architecture and operating system
to be overwritten via the new `--os` and `--arch` flags. This allows the
use case of packing pre-built or cross-compiled binaries into container
images with specifying the correct environment. The `--platform` flag
now takes the `os/arch` format into account as well.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>

Closes: #2097
Approved by: rhatdan
2020-01-21 12:25:09 +00:00
TomSweeneyRedHat 0c3234f226 Fix COPY in containerfile with envvar
If a Containerfile had lines like:

```
FROM alpine
ENV VERSION=0.0.1
COPY file-${VERSION}.txt /
```

Buildah would not resolve the VERSION variable in the copy statement.
If the 'ENV' in the above Containerfile was changed to ARG, then this
would work.

A recent change to the handling of variables now only looks at variables
set by 'ARG' and not the ones set by the 'ENV' command.  This PR
adds the the variables set by the `ENV` to the list of `ARG` variables
when those variables are being resolved by the code.

This also includes added test to guard against this regression in the future.

Addresses:  https://github.com/containers/libpod/issues/4878

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

Closes: #2095
Approved by: giuseppe
2020-01-20 23:37:31 +00:00
Ed Santiago 45543bf9b2 buildah bud --volume: run from tmpdir, not source dir
PR #2039 broke system tests, because they're installed in /usr:

   # buildah bud -v /usr/share/buildah/test/system:/testdir:rw,z /usr/share/buildah/test/system/bud/mount
   ...
   error building at STEP "RUN mount": error resolving mountpoints for container "173c5e567e95f2604b5ea677f5e5364839d5b455a9081cdb4101f20242997e5e": relabeling "/usr/share/buildah/test/system" failed: relabeling content in /usr is not allowed

Solution: mount a volume from TESTDIR (singular), which is in TMPDIR,
not TESTSDIR (plural), which is our test source dir.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2065
Approved by: vrothberg
2020-01-07 09:29:52 +00:00
Boaz Shuster 8d41b83622 discard outputs coming from onbuild command on buildah-from --quiet
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>

Closes: #2055
Approved by: rhatdan
2020-01-03 14:20:41 +00:00
TomSweeneyRedHat 6941254c29 Fix option handling for volumes in build
If the volume option was specified like: `--volume "${HOME}/.cache/zae9ujei:/myvol:rw,Z"`,
the COBRA code that processed the input from the user was considering the value to be a
SliceVar with two volumes `${HOME}/.cache/zae9ujei:/myvol:rw` and `Z` due to the comma.

Converted the COBRA code to consider the input as an ArrayVar instead and the value is
handled appropriately.  Also increased the testing to catch this going forward.

Addresses: #2000

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

Closes: #2039
Approved by: rhatdan
2019-12-22 15:06:05 +00:00
Ed Santiago 77db7f959e BATS major cleanup: part 4: manual stuff
This is the manual part of the cleanup.

  - remove most 'buildah rm's from cleanup steps
  - remove unused variables
  - use expect_output when possible, not 'test [ x = y ]'
    - includes fixing some not-what-you-think-it-is uses
      of run_buildah | grep
  - be careful not to leave droppings in current directory

Special attention to:

  - authenticate.bats: create Dockerfile in temp dir, not pwd!
  - push.bats: remove broken output check
  - registries.bats: refactor, remove duplicate tests & code
  - rmi.bats: better checking of messages
  - secrets.bats: use TESTDIR (tmp), not TESTSDIR (/usr/share) !
    We don't want to leave droppings behind if we fail; this has
    bitten us before. And, since there's only one test, there's
    no need to override setup() / teardown(). Do setup inline,
    and take advantage of existing defaults.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
Ed Santiago 6063bff02a BATS major cleanup, step 3: yet more run_buildah
Replace plain 'buildah' invocations with run_buildah

For ease of review, this commit was entirely machine-generated via:

   $ perl -pi -e 's/^(\s+)buildah(\s)/${1}run_buildah${2}/' *.bats

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
Ed Santiago 229b18f6a8 BATS major cleanup, part 2: use more run_buildah
Replace this pattern:

       cid=$(buildah ...)
with:
       run_buildah ...
       cid=$output

As a special case, if the buildah command is 'from' and the
string 'scratch' does not appear in the arguments, add '--quiet'.
Otherwise we'll get Pulling messages as part of $output. This
is an overkill solution.

For ease of review, this commit was entirely machine-generated via:

   $ perl -pi -e 's{^(\s+)(\S+)=\$\(buildah (.*)\)$}{$indent=$1;$var=$2;$cmd=$3; $cmd =~ s/(\bfrom)\s(?!.*scratch)/$1 --quiet $2/; "${indent}run_buildah $cmd\n$indent$var=\$output"}e' *.bats

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
Ed Santiago dee4b68ef0 BATS major cleanup, part 1: log-level
PR #1935 removed the default --debug logging; so all run_buildah
calls now use the default (error). It is safe to remove unnecessary
instances of --log-level=error .

For ease of review, this commit was entirely machine-generated via:

    $ perl -pi -e 's/ --log-level=error / /' *.bats

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2029
Approved by: rhatdan
2019-12-17 18:16:45 +00:00
TomSweeneyRedHat db59421d52 Allow ADD to use http src
In #1977 we disallowed the use of a URL for both the
COPY and ADD commands in a Dockerfile.  Upon further
reflection we should have done that only for the COPY
command.

Addresses: https://github.com/containers/libpod/issues/4686

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

Closes: #2019
Approved by: rhatdan
2019-12-13 14:11:40 +00:00
Ed Santiago d55a9f8893 PR takeover of #1966
PR 1966 has languished for three weeks without activity from
submitter. In the interests of getting it online, I have
taken it over and:

  - rebased
  - fixed several misunderstandings (bugs) noted in review feedback
  - fixed a few more

I also slightly rewrote two tests (tag by id, commit with name)
that were incomprehensible to me: unnecessary mount/umount and
no actual testing of anything other than checking exit status.
I believe the new code is closer to the intention of testing
but please pay closer attention to those bits.

Also: fixed the basic 'inspect' test. It looks like at some
point in the last month #1917 added a version string to
the buildah-inspect output. The test was fixed on master,
but ypu's PR did not incorporate those fixes and the
test was breaking. I took the liberty of cleaning up
the entire test for readability and maintainability.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #2004
Approved by: rhatdan
2019-12-04 01:56:01 +00:00
Yiqiao Pu f05a9b778a Tests: Add buildah bud with --quiet test
Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #2004
Approved by: rhatdan
2019-12-04 01:56:01 +00:00
TomSweeneyRedHat ed0a329d9e Handle missing equal sign in --from and --chown flags for COPY/ADD
When buildah bud runs without layers (default), it hands off the parsing
of the Dockerfile steps to imagebuilder.  However if the the --layers
option is in use, then we start parsing the steps before we hand stuff
off to imagebuilder.

The COPY --chown, ADD --chown, and COPY --from commands in a Dockerfile
were failing if there was not an '=' sign after them like "COPY --chown=2374:3256".
This moves the parsing into the code that handles the layer processing.

Fixes: #1984

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

Closes: #1997
Approved by: vrothberg
2019-12-03 09:44:46 +00:00
Qi Wang 4cf37c277a bud COPY does not download URL
close #1846
buildah bud COPY can download the URL to the container working directory. This is not compatible with Docker.
So after this path, buildah bud COPY URL will return an error.

Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: #1977
Approved by: QiWang19
2019-11-25 16:49:36 +00:00
Qi Wang f995696f28 Check nonexsit authfile
Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: #1967
Approved by: rhatdan
2019-11-07 04:07:07 +00:00
Daniel J Walsh 147d106c36 Only output image id if running buildah bud --quiet
We should be outputing just the imageID when doing a buildah bud quiet.
Currently the stdout from containers is showing up on the screen.

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

Closes: #1963
Approved by: TomSweeneyRedHat
2019-11-06 22:35:55 +00:00
TomSweeneyRedHat 89bc2a6a6a Fix --pull=true||false and add --pull-never to bud and from (retry)
(Replaces #1873 as it had lint issues that were timing out tests that I couldn't
track down easily)

Prior to this fix, if someone did `buildah bud --pull=false .` and the image in
the Containerfile's FROM statement was not local, the build would fail. The same
build on Docker will succeed. In Docker, when `--pull` is set to false, it only
pulls the image from the registry if there was not one locally. Buildah would never
pull the image and if the image was not locally available, it would throw an error.
In certain Kubernetes environments, this was especially troublesome.

To retain the old `--pull=false` functionality, I've created a new `--pull-never`
option that fails if an image is not locally available just like the old
`--pull=false` option used to do.

In addition, if there was a newer version of the image on the repository than
the one locally, the `--pull=true` option would not pull the image as it should
have, this corrects that.

Changes both the from and bud commands.

Addresses: #1675

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

Closes: #1959
Approved by: rhatdan
2019-11-06 22:20:24 +00:00
Ed Santiago 124ef951ce Prepwork: new 'skip' helpers for tests
Refactor many cumbersome BUILDAH_ISOLATION and 'which runc'
checks into common 'skip_if_{ chroot, rootless, no_runtime}'
calls.

This is in preparation for the next PR, which introduces
additional cgroups-v2 skips.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #1965
Approved by: rhatdan
2019-11-06 15:18:22 +00:00
TomSweeneyRedHat 5294f0ab79 Update bud.bats test archive test
After #1955 merged, @edsantiago had suggestions for
tweaks to the test that was part of that merge.
This PR addresses those comments.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-10-31 08:20:30 -04:00
TomSweeneyRedHat 8e26456163 Add test for caching based on content digest
Add Tom's test for cache checking from #1929.

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

Closes: #1955
Approved by: rhatdan
2019-10-31 00:37:18 +00:00
Ed Santiago 46ba99c47f yet more fixes
- add explicit --log-level=debug in some buildah-bud invocations
  where we need to check debug output
- use expect_line_count() in one place, to get better diagnostics
- formats test: refactor, make more readable
- imgtype invoker: remove -debug
- fix one more instance of 'step' needing to be 'STEP'
- fix one mkdir to mkdir -p, and run rm -rf beforehand, to deal
  with a failed prior run that might have left state

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #1935
Approved by: giuseppe
2019-10-30 11:45:12 +00:00
Ed Santiago 944aee2128 BATS tests - lots of mostly minor cleanup
First, and possibly most controversial, remove --debug flag.
Output on test failure is painful to read. It is unlikely
(but not inconceivable) that --debug will be of any use.

Second, fix a failure message so it properly uses %s instead
of string interpolation. (If the test name itself includes
a percent sign, we get undefined behavior on output).

Fix a few instances of 'buildah' to be 'run_buildah'.

Remove some unnecessary 'run/echo/check-status' sequences,
sticking with the much cleaner 'test'. When BATS shows
an error of the form 'this failed: [ $status -eq 0 ]'
I weep in despair.

Signed-off-by: Ed Santiago <santiago@redhat.com>

Closes: #1935
Approved by: giuseppe
2019-10-30 11:45:12 +00:00
Qi Wang cddb66e662 Enable --device directory as src device
Enables --device accepte directory path as source device. Add the devices under the source directory to the destination directory.

complete card test criteria: https://jira.coreos.com/browse/RUN-497
related podman issue: https://github.com/containers/libpod/issues/2380

Signed-off-by: Qi Wang <qiwan@redhat.com>

Closes: #1937
Approved by: rhatdan
2019-10-25 12:42:22 +00:00
TomSweeneyRedHat fa4eec7328 Fix git build with branch specified
If the context directory was specified as a git repo with a
branch reference ala

```
buildah bud --layers -t test git://github.com/containers/skopeo#master
```

The internal `git clone` command executed by buildah would fail as the
`#master` branch specification needed to be removed and specified with
the `-b` option like:

```
git clone -b master git://github.com/containers/skopeo /var/tmp/buildah12332
```
rather than:
```
git clone git://github.com/containers/skopeo#master /var/tmp/buildah12332
```

Addresses #1934

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

Closes: #1941
Approved by: rhatdan
2019-10-23 12:01:49 +00:00
caiges 13330a45a4 Fix crash when invalid COPY --from flag is specified.
- Add a test for invalid COPY statements.
- Add missing dockerfile.

Signed-off-by: caiges <caigesn@gmail.com>

Closes: #1898
Approved by: TomSweeneyRedHat
2019-10-09 17:13:05 +00:00
TomSweeneyRedHat f50b55df9a Fix --build-args handling
When passing an environment variable to a Containerfile using an `ARG` command,
the dry-run processing  for `COPY` and `ADD` isn't resolving the environment
variable for the source and is causing a failure.

Now convert the source if it's an environment variable to its value and then
proceed on.  The destination doesn't have a similar issue at this point
but we'll convert it too just in case.

Addresses: #1871

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

Closes: #1874
Approved by: nalind
2019-10-02 20:36:04 +00:00
Sachi King e2c33f36f2 Add support for retrieving context from stdin "-"
Some consumers of the docker command line API expect to be able to pass
a tar or a Dockerfile into the build command via stdin, which causes a
build failure when it hits 'buildah bud' or 'podman build', which calls
buildah.  A good example of this is the `linuxkit pkg build $dir`
command, which will append a `-` to the build command.

To improve compatibility with `docker build` support for `-` is added to
mean "read from stdin".
While a user could pass /dev/stdin or /proc/self/fd/0, or a path to some
other character device, as such tricks are common when attempting to get
programs to read from stdin, `docker build` does not support this, thus
this leaves out a bit of complexity while improving 'docker build' cli
compatibility.

Signed-off-by: Sachi King <nakato@nakato.io>

Closes: #1870
Approved by: rhatdan
2019-10-01 12:40:59 +00:00
TomSweeneyRedHat d2c1fd8ec2 Use Containerfile by default
Use the file named "Containerfile" if no build file is specified.  If
not found, fall back to Dockerfile.

This is the initial PR, we probably will have more doc tweaking to do overtime.

```
STEP 1: FROM alpine
STEP 2: COMMIT tom
961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4

STEP 1: FROM alpine
STEP 2: COMMIT tom
961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4

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

Closes: #1860
Approved by: rhatdan
2019-09-17 17:41:24 +00:00
Daniel J Walsh 20a33e0791 Add --devices flag to bud and from
Some Dockerfiles (fuse-overlay) require additional devices to be in the
build environment.

This patch allows the user to specify additional devices.

Also I noticed that CapAdd and CapDrop was not working in buildah bud situations,
so this patch also fixes this.

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

Closes: #1820
Approved by: @TomSweeneyRedHat
2019-09-07 17:32:43 +00:00
Nalin Dahyabhai cc80ccc252 makeImageRef: ignore EmptyLayer if Squash is set
If Squash is set, then we're only committing one layer, so if EmptyLayer
is set, which would normally tell us to skip committing the final layer,
we should ignore the EmptyLayer flag.

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

Closes: #1839
Approved by: TomSweeneyRedHat
2019-09-04 23:00:41 +00:00
Daniel J Walsh b643073bce
Merge pull request #1836 from bbodiya-akamai/master
fix label and annotation for 1-line Dockerfiles
2019-09-04 15:11:51 -04:00