build context is ignored

43 views
Skip to first unread message

stav alfi

unread,
Oct 29, 2020, 1:50:33 PM10/29/20
to quay-sig
I can't seem to understand how to specify the context location.

json: {
subdirectory: 'k8test-master/packages/monitoring/',
docker_tags: ['1.0.1'],
context: 'k8test-master/',
},
})

In the dockerfile, I have a file in: `k8test-master/yarn.lock`

but in the build, I get an error:

A build step failed: COPY failed: stat /var/lib/docker/tmp/docker-builder000159049/yarn.lock: no such file or directory

Why docker-build didn't try to take the file from the specified context?

stav alfi

unread,
Nov 14, 2020, 2:42:43 PM11/14/20
to quay-sig
by looking at the source code, im not even sure this feature was ever supported or even tested. 

can you please verify? 

thanks!

Ivan Bazulic

unread,
Nov 14, 2020, 3:18:34 PM11/14/20
to stav alfi, quay-sig
Hi Stav,

It was, it works and it is supported. You've explicitly set the context of the build to be k8stest_master. That is your root directory for youe context within your archive. So unless you have another directory inside that is named k8stest_master, the build will fail. Try copying the file without the path specified. So:

COPY yarn.lock /dest/path


Thanks! 

--
You received this message because you are subscribed to the Google Groups "quay-sig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quay-sig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quay-sig/09596665-dd99-4f32-b155-61a6a3e22cc6n%40googlegroups.com.

stav alfi

unread,
Nov 14, 2020, 4:55:19 PM11/14/20
to quay-sig
Hi Ibaz,

Thanks for the response. I have spent hours on this error. \
I want to make sure that I fully understand your help:

In the error (COPY failed: stat /var/lib/docker/tmp/docker-builder000159049/yarn.lock: no such file or directory), it looks like the root directly of the context is /var/lib/docker/tmp/docker-builder000159049, even when I override it.

Also, in my dockerfile, I already have "COPY yarn.lock /dest/path".

Can you explain why do you think that the context is something else?

Thanks again!

Ivan Bazulic

unread,
Nov 16, 2020, 6:17:23 AM11/16/20
to stav alfi, quay-sig
On Sat, Nov 14, 2020 at 9:55 PM stav alfi <stav...@gmail.com> wrote:
Hi Ibaz,

Thanks for the response. I have spent hours on this error. \
I want to make sure that I fully understand your help:

In the error (COPY failed: stat /var/lib/docker/tmp/docker-builder000159049/yarn.lock: no such file or directory), it looks like the root directly of the context is /var/lib/docker/tmp/docker-builder000159049, even when I override it.

Also, in my dockerfile, I already have "COPY yarn.lock /dest/path".

Can you explain why do you think that the context is something else?

Thanks again!

In your case, I believe that the subdirectory and context statements were in collision for some reason. Context was set correctly but the build was run as if k8master-test/packages/monitoring was the root directory for the build. I've downloaded your tar file and built my own Quay/builder combo to see exactly what went wrong. This is what I found works for me and starts the building process correctly:

{"archive_url": "https://github.com/stavalfi/k8test/archive/master.tar.gz", "docker_tags": [    "test-build"], "context": "/k8test-master", "dockerfile_path": "/k8test-master/packages/monitoring/Dockerfile"}

With this JSON payload, the built starts but eventually fails on the 

COPY packages/monitoring/dist/src ./packages/monitoring/dist/src

step, because this directory does not exist within the archive. 
 
HTH!
-- 

IVAN BAŽULIĆ

SENIOR SUPPORT ENGINEER

Red Hat EMEA

Communications House,
Cork Road,
Waterford X91 NY33

ibaz...@redhat.com    M: +385959269281     IM: ibazulic

stav alfi

unread,
Nov 16, 2020, 5:18:44 PM11/16/20
to quay-sig
Thats help so much! Thank you for taking the extra mile to reproduce it and give me a working example!

Also, does quay.io has a rate-limit on how much builds can be triggered in a day?

Ivan Bazulic

unread,
Nov 17, 2020, 6:24:37 AM11/17/20
to stav alfi, quay-sig
On Mon, Nov 16, 2020 at 10:18 PM stav alfi <stav...@gmail.com> wrote:
Thats help so much! Thank you for taking the extra mile to reproduce it and give me a working example!

You're welcome :-)
 

Also, does quay.io has a rate-limit on how much builds can be triggered in a day?


 There are no limits as to how many builds you can queue. There is a limit to how many builds you can run concurrently though, you can run only one build inside one repository in parallel. However, multiple builds can be run at the same time if they are referencing different repos. So for example, if you want to build 5 tags in one repository, each tag will be built consecutively, one at a time. However, if you want to build 5 tags across 5 repositories, theoretically all these should be done in parallel, simultaneously. In practice, the number of concurrent builds depends on the number of free builder nodes and the number of previously queued builds. But there are no limits as to how many builds you can queue, they will all be done in due time.

HTH!
Reply all
Reply to author
Forward
0 new messages