# Drone plugin - docker without \`--no-cache\` option

**URL:** <https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855>\
**Category:** Drone Support\
**Created:** [September 7, 2017, 9:09am UTC](https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855 "2017-09-07T09:09:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozbillwang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ozbillwang/32/3947_2.png) [@ozbillwang](https://drone.discourse.group/u/ozbillwang)\
**Post date:** [September 7, 2017, 9:09am UTC](https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855/1 "2017-09-07T09:09:10Z")

</div>

When using drone plugin `plugins/docker`, I found if there is no docker option `--no-cache`.

[drone-docker](http://plugins.drone.io/drone-plugins/drone-docker/)

Could you please confirm?

---

<div class="post-metadata">

**Author:** ![jhernandez](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jhernandez/32/4244_2.png) [@jhernandez](https://drone.discourse.group/u/jhernandez)\
**Post date:** [September 7, 2017, 4:12pm UTC](https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855/2 "2017-09-07T16:12:55Z")

</div>

No there is not but there is a `build_args`

`build_args: ["--no-cache"]`

And since the plugin runs docker:dind I don’t think you would need such an option since with every build there will be no cache.

---

<div class="post-metadata">

**Author:** ![ozbillwang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ozbillwang/32/3947_2.png) [@ozbillwang](https://drone.discourse.group/u/ozbillwang)\
**Post date:** [December 18, 2017, 5:19am UTC](https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855/3 "2017-12-18T05:19:32Z")

</div>

![30 pm](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/1X/47f7b111ae30bef1f357b07ab292b28143c83ab8.png)

I can see the docker build using cache.

I added `build_args: ["--no-cache"]`, but still same result.

The real docker build command is `--build-arg --no-cache` which is wrong.

---

<div class="post-metadata">

**Author:** ![ozbillwang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ozbillwang/32/3947_2.png) [@ozbillwang](https://drone.discourse.group/u/ozbillwang)\
**Post date:** [December 18, 2017, 6:51am UTC](https://drone.discourse.group/t/drone-plugin-docker-without-no-cache-option/8855/5 "2017-12-18T06:51:48Z")

</div>

For anyone who can’t wait the problem to be fixed, I make a hard code in `docker.go`

```diff
diff --git a/docker.go b/docker.go
index 229a1d0..fe6c81d 100644
--- a/docker.go
+++ b/docker.go
@@ -184,6 +184,7 @@ func commandBuild(build Build) *exec.Cmd {
        args := []string{
                "build",
                "--rm=true",
+ "--no-cache",
                "-f", build.Dockerfile,
                "-t", build.Name,
        }

```

And I manually built the plugin image to `ozbillwang/docker:1.0`. You can pull and use it directly.
