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

Glob COPY is failing #3318

Closed
sjenning opened this issue Jun 18, 2021 · 7 comments
Closed

Glob COPY is failing #3318

sjenning opened this issue Jun 18, 2021 · 7 comments

Comments

@sjenning
Copy link
Contributor

Description

Glob COPY is failing on very basic case

Steps to reproduce the issue:

$ cat Dockerfile.prebuilt 
FROM quay.io/openshift/origin-base:4.8
COPY bin/* /usr/bin/
ENTRYPOINT /usr/bin/hypershift

$ ls bin
control-plane-operator  hosted-cluster-config-operator  hypershift  hypershift-operator  ignition-server

$ buildah bud -f Dockerfile.prebuilt
STEP 1: FROM quay.io/openshift/origin-base:4.8
STEP 2: COPY bin/* /usr/bin/
error building at STEP "COPY bin/* /usr/bin/": no items matching glob "/home/sjennings/projects/go/src/github.com/openshift/hypershift/bin/*" copied (5 filtered out): no such file or directory
ERRO[0001] exit status 125

Describe the results you received:

all files matching the glob are filtered

Describe the results you expected:

all files matching the glob should be copied without error

Output of rpm -q buildah or apt list buildah:

buildah-1.21.0-1.fc34.x86_64

Output of buildah version:

Version:         1.21.0
Go Version:      go1.16.3
Image Spec:      1.0.1-dev
Runtime Spec:    1.0.2-dev
CNI Spec:        0.4.0
libcni Version:  
image Version:   5.12.0
Git Commit:      
Built:           Wed Dec 31 18:00:00 1969
OS/Arch:         linux/amd64

Output of podman version if reporting a podman build issue:

Version:      3.1.2
API Version:  3.1.2
Go Version:   go1.16.3
Built:        Wed May 12 14:27:59 2021
OS/Arch:      linux/amd64

Output of cat /etc/*release:

Fedora release 34 (Thirty Four)
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/34/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 34 (Thirty Four)
Fedora release 34 (Thirty Four)

Output of uname -a:

Linux <hidden> 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of cat /etc/containers/storage.conf:

driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"
[storage.options]
additionalimagestores = [
]
[storage.options.overlay]
mountopt = "nodev,metacopy=on"
[storage.options.thinpool]
@rhatdan
Copy link
Member

rhatdan commented Jun 18, 2021

Worked for me with 1.21.1

tmp $ mkdir bin
tmp $ cd bin/
bin $ touch control-plane-operator  hosted-cluster-config-operator  hypershift  hypershift-operator  ignition-server
bin $ cd ..
tmp $ cat > Dockerfile.prebuilt
FROM quay.io/openshift/origin-base:4.8
COPY bin/* /usr/bin/
ENTRYPOINT /usr/bin/hypershift
tmp $ buildah bud -f Dockerfile.prebuilt
STEP 1: FROM quay.io/openshift/origin-base:4.8
Trying to pull quay.io/openshift/origin-base:4.8...
Getting image source signatures
Copying blob 9f53cb1b4beb done  
Copying blob 51dd190beeee done  
Copying blob 33db084abe90 done  
Copying blob 99920319b5be done  
Copying blob d0c9851d609d done  
Copying config ca5374ba40 done  
Writing manifest to image destination
Storing signatures
STEP 2: COPY bin/* /usr/bin/
STEP 3: ENTRYPOINT /usr/bin/hypershift
STEP 4: COMMIT
WARN[0034] ignoring metacopy option from storage.conf, not supported with booted kernel 
Getting image source signatures
Copying blob 98469092e604 skipped: already exists  
Copying blob bfb9caafb0fc skipped: already exists  
Copying blob 81dffb147c3b skipped: already exists  
Copying blob c73d595645be skipped: already exists  
Copying blob 84febe1f80a9 skipped: already exists  
Copying blob c211041f7637 done  
Copying config 9d2594a47b done  
Writing manifest to image destination
Storing signatures
--> 9d2594a47b3
9d2594a47b35d24ef5337b623d5fc3e2fa3183d46fbc40e63e9b14de5e0c5a69
tmp $ buildah -v
buildah version 1.21.1 (image-spec 1.0.1-dev, runtime-spec 1.0.2-dev)
tmp $ rpm -q buildah
buildah-1.21.1-1.fc34.x86_64

@rhatdan rhatdan closed this as completed Jun 18, 2021
@sjenning
Copy link
Contributor Author

sjenning commented Aug 4, 2021

In case anyone comes across this, there was a .dockerignore file in the repo 🤦‍♂️

@aramcap
Copy link

aramcap commented Oct 7, 2021

In case anyone comes across this, there was a .dockerignore file in the repo 🤦🏼‍♂️

¡THANKS! 👏🏼 👏🏼

I think that the error/exception is very poor of information. They must says some similar to "no items matching glob in .dockerignore .containerignore".

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2021

We support .containerignore (Preferred, as well as overriding the path).

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2021

Would this error message have helped?

 ./bin/buildah build /tmp/test
STEP 1/2: FROM scratch
STEP 2/2: COPY bin/* /usr/bin/
error building at STEP "COPY bin/* /usr/bin/": no items matching glob "/tmp/test/bin/*"from /tmp/test/.dockerignore copied (3 filtered out): no such file or directory
ERRO[0000] exit status 125  

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2021

How about:
error building at STEP "COPY bin/* /usr/bin/": no items matching glob "/tmp/test/bin/*" copied (3 filtered out using /tmp/test/.dockerignore): no such file or directory

@aramcap
Copy link

aramcap commented Oct 7, 2021

Would this error message have helped?

 ./bin/buildah build /tmp/test
STEP 1/2: FROM scratch
STEP 2/2: COPY bin/* /usr/bin/
error building at STEP "COPY bin/* /usr/bin/": no items matching glob "/tmp/test/bin/*"from /tmp/test/.dockerignore copied (3 filtered out): no such file or directory
ERRO[0000] exit status 125  

Yes! For me, any mention to .containerignore/.dockerignore in the message is really good.

rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 7, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 7, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 9, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 9, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 9, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 12, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 13, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 14, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
rhatdan added a commit to rhatdan/buildah that referenced this issue Oct 15, 2021
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.

This change is an attempt to add this data to the error.
Example: containers#3318

Signed-off-by: Daniel J Walsh <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants