# Docker image build failed

**URL:** <https://renku.discourse.group/t/docker-image-build-failed/104>\
**Category:** RenkuLab\
**Created:** [14 May 2020 10:12 UTC](https://renku.discourse.group/t/docker-image-build-failed/104 "2020-05-14T10:12:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 10:12 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/1 "2020-05-14T10:12:02Z")

</div>

One of my students experienced the following error when trying to build a [fork of the course project](https://renkulab.io/projects/laurent.gatto/wsbim1207/).

 ![Screenshot 2020-05-14 at 10.48.49](https://global.discourse-cdn.com/free1/uploads/renku/original/1X/3c47bc454c479a23a0cbd13fe68192ac61bd9bb0.png)

I found a previous [similar post](https://renku.discourse.group/t/docker-image-error-the-docker-image-build-failed/47), but that seemed to relate to a new project that hadn’t build yet. In my case, the project has build successfully in the past and even today.

I have ask my students to provide the error following the _View pipeline in GitLab_ link, that I will append here if I get it.

In the meantime, let me know if anyone has already experienced something similar.

---

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 11:37 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/2 "2020-05-14T11:37:45Z")

</div>

Here’s what has been reported.

```auto
ERROR: Job failed: execution took longer than 1h0m0s seconds

```

Surprisingly, (1) starting the new environment was very fast when I tested it and (2) the timeout CI/CD settings on GitLab is set to 2h. (Note however that the students might have initially forked the project before the timeout was increased to 2h.)

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [14 May 2020 12:20 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/3 "2020-05-14T12:20:16Z")

</div>

Hi @lgatto, thanks for reporting this - unfortunately this is a bit of an annoying “feature” of GitLab CI. These settings are not carried over to the forks. So if you have changed it in your project, the students must do the same in their projects.

---

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 12:51 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/4 "2020-05-14T12:51:57Z")

</div>

I see, indeed. Thank you @rrrrrok for pointing this out.

Is it possible to set environment variables in a config file that would be forked with the project?

---

<div class="post-metadata">

**Author:** ![pameladelgado](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/pameladelgado/32/28_2.png) [@pameladelgado](https://renku.discourse.group/u/pameladelgado)\
**Post date:** [14 May 2020 12:52 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/5 "2020-05-14T12:52:02Z")

</div>

hi @lgatto  
you can also change the timeout in the `.gitlab-ci.yaml` file inside the `image_build` section:

```auto
image_build:
  timeout: 3 hours
...

```

this way, the following forks will include the modified timeout

---

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 12:52 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/6 "2020-05-14T12:52:37Z")

</div>

There you go, thank you very much!

---

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 14:27 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/7 "2020-05-14T14:27:30Z")

</div>

I’m following up as I see some inconsistencies. I updated the `gitlab-ci.yml` file in the project as you suggested. It says 3 hours. However, when I check through the GitLab web interface, the CI/CD Settings still display the 2h timeout.

Similarly, when I fork the project using another user account, the forked `gitlab-ci.yml` file says 3 hours, but the GitLab CI/CD Settings display 1h.

Does the timout in the config file take precedence?

---

<div class="post-metadata">

**Author:** ![pameladelgado](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/pameladelgado/32/28_2.png) [@pameladelgado](https://renku.discourse.group/u/pameladelgado)\
**Post date:** [14 May 2020 14:36 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/8 "2020-05-14T14:36:47Z")

</div>

There are timeouts at three levels: Job level (specified in `gitlab-ci.yml` file), Project level (via GitLab CI/CD settings) and Runner level (setup by admins/us).  
When the project is forked, it will inheritate the Job level timeout since its in the cloned file, but still have the default `1h` project level timeout.

The timeout in the config file takes precedence over the project configuration, but not over the runner configuration. From the [GitLab CI docs](https://docs.gitlab.com/ee/ci/yaml/#timeout):

> The job-level timeout can exceed the [project-level timeout](https://docs.gitlab.com/ee/ci/pipelines/settings.html#timeout) but can’t exceed the Runner-specific timeout.

Hope this made it clearer!

---

<div class="post-metadata">

**Author:** ![lgatto](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lgatto/32/64_2.png) [@lgatto](https://renku.discourse.group/u/lgatto)\
**Post date:** [14 May 2020 15:22 UTC](https://renku.discourse.group/t/docker-image-build-failed/104/9 "2020-05-14T15:22:29Z")

</div>

Thank you @pameladelgado
