# QIIME Docker image always caching when used with cwltool

**URL:** <https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919>\
**Category:** User Support\
**Tags:** docker\
**Created:** [July 6, 2018, 3:47pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919 "2018-07-06T15:47:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnbradley](https://forum.qiime2.org/user_avatar/forum.qiime2.org/johnbradley/32/20039_2.png) [@johnbradley](https://forum.qiime2.org/u/johnbradley)\
**Post date:** [July 6, 2018, 3:47pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/1 "2018-07-06T15:47:37Z")

</div>

I am attempting to use the `qiime2/core:2018.6` docker image with [cwltool](https://github.com/common-workflow-language/cwltool).  
Every time I run a command it prints out the following message:

> QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.

This is due to how cwltool creates a temporary home directory for each command run. This helps create a sanitary environment for running commands. Unfortunately this throws away the qiime2 cache.

I was able to work around this by creating my own docker images specifying a value for XDG\_CONFIG\_HOME:

```auto
FROM qiime2/core:2018.6
ENV XDG_CONFIG_HOME /qiime2_cache
RUN qiime dev refresh-cache
CMD bash

```

Do you know of any issues with using this approach to store the qiime2 cached data inside the docker image?

Thanks.

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 6, 2018, 3:47pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/2 "2018-07-06T15:47:44Z")

</div>



---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 6, 2018, 3:48pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/3 "2018-07-06T15:48:38Z")

</div>

> [@johnbradley](#):
>
> I was able to work around this by creating my own docker images specifying a value for XDG\_CONFIG\_HOME

👍

> [@johnbradley](#):
>
> Do you know of any issues with using this approach to store the qiime2 cached data inside the docker image?

Sounds reasonable to me - we do something similar in the official image: [vm-playbooks/docker/Dockerfile at master · qiime2/vm-playbooks · GitHub](https://github.com/qiime2/vm-playbooks/blob/master/docker/Dockerfile#L16)

I wonder if there is something we could do different in the future to make the official image more portable?

Anyway, thanks for checking, keep us posted!

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 6, 2018, 3:49pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/4 "2018-07-06T15:49:32Z")

</div>



---

<div class="post-metadata">

**Author:** ![johnbradley](https://forum.qiime2.org/user_avatar/forum.qiime2.org/johnbradley/32/20039_2.png) [@johnbradley](https://forum.qiime2.org/u/johnbradley)\
**Post date:** [July 6, 2018, 5:46pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/5 "2018-07-06T17:46:19Z")

</div>

Thanks for the quick response.

I think if you added something like `ENV XDG_CONFIG_HOME /qiime2_cache` above the `RUN qiime dev refresh-cache` in your docker file it would fix this for the official image. If you are interested in such a change I could create a PR.

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 8, 2018, 12:48am UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/6 "2018-07-08T00:48:03Z")

</div>



---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 9, 2018, 11:23pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/7 "2018-07-09T23:23:09Z")

</div>

Thanks @johnbradley!

> [@johnbradley](#):
>
> If you are interested in such a change I could create a PR.

[A PR would be great](https://github.com/qiime2/vm-playbooks)! Thanks! :qiime2: 🦖

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 9, 2018, 11:23pm UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/8 "2018-07-09T23:23:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [August 10, 2018, 5:23am UTC](https://forum.qiime2.org/t/qiime-docker-image-always-caching-when-used-with-cwltool/4919/9 "2018-08-10T05:23:15Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
