# Build fails when using auto\_tag in Docker plugin

**URL:** <https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049>\
**Category:** Drone Support\
**Created:** [April 30, 2018, 2:54pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049 "2018-04-30T14:54:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vshulev](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/vshulev/32/5609_2.png) [@vshulev](https://drone.discourse.group/u/vshulev)\
**Post date:** [April 30, 2018, 2:54pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/1 "2018-04-30T14:54:01Z")

</div>

Hi there,

I’m getting the following error when trying to use the Docker plugin with “auto\_tag” set to true:

- /usr/local/bin/docker tag c36b6249e21c3aacd091f1f76f6f000d47837904 :latest  
Error parsing reference: “:latest” is not a valid repository/tag: invalid reference format

Looks like there is an extra colon being appended to the tag name?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [April 30, 2018, 3:28pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/2 "2018-04-30T15:28:26Z")

</div>

@vshulev please help us help you buy posting a full example of your yaml configuration file. It looks like you are missing the `repo` attribute, however, we would need to see your configuration to properly diagnose.

---

<div class="post-metadata">

**Author:** ![vshulev](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/vshulev/32/5609_2.png) [@vshulev](https://drone.discourse.group/u/vshulev)\
**Post date:** [May 1, 2018, 6:28am UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/3 "2018-05-01T06:28:51Z")

</div>

Hi @bradrydzewski,  
Thanks for the amazingly quick response! Yes, the issue was that I was missing the `repo` attribute. It’s all working out now 🙂 Thanks, for the help!

---

<div class="post-metadata">

**Author:** ![Skogsfrae](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/skogsfrae/32/5811_2.png) [@Skogsfrae](https://drone.discourse.group/u/Skogsfrae)\
**Post date:** [February 1, 2019, 4:42pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/4 "2019-02-01T16:42:10Z")

</div>

Hi there.  
I’m having the same problem, but I’ve had the `repo` attribute filled from the start.

Here’s my conf:

```
 docker-build:
    image: plugins/docker
    settings:
      username:
        from_secret: docker-user
      password:
        from_secret: docker-password
      repo: my.docker-registry.com/my-app/server
      registry: my.docker-registry.com
      tags: latest

```

My step output:

```
Successfully built a03c5ce51dd3
Successfully tagged 0bc3414d19f1e423e12c7c5c111c9156689e67b8:latest
+ /usr/local/bin/docker tag 0bc3414d19f1e423e12c7c5c111c9156689e67b8 :latest
Error parsing reference: ":latest" is not a valid repository/tag: invalid reference format
```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 1, 2019, 4:45pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/5 "2019-02-01T16:45:22Z")

</div>

@Skogsfrae your configuration is invalid. The yaml syntax in your example is a mixture of 0.8 and 1.0, and therefore will fail in both versions of Drone.

---

<div class="post-metadata">

**Author:** ![Skogsfrae](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/skogsfrae/32/5811_2.png) [@Skogsfrae](https://drone.discourse.group/u/Skogsfrae)\
**Post date:** [February 1, 2019, 4:51pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/6 "2019-02-01T16:51:22Z")

</div>

@bradrydzewski thanks a lot for your quick answer!  
Is a doc of docker plugin syntax for 0.8 still available or should I update to 1.0 in order to use it?

---

<div class="post-metadata">

**Author:** ![Skogsfrae](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/skogsfrae/32/5811_2.png) [@Skogsfrae](https://drone.discourse.group/u/Skogsfrae)\
**Post date:** [February 1, 2019, 5:00pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/7 "2019-02-01T17:00:21Z")

</div>

Found this if someone else is going to need it [https://github.com/drone/drone-plugin-index/blob/2feceac8f3be03b706a2515c089eac290aba95b7/content/drone-plugins/drone-docker/index.md](https://github.com/drone/drone-plugin-index/blob/2feceac8f3be03b706a2515c089eac290aba95b7/content/drone-plugins/drone-docker/index.md)

---

<div class="post-metadata">

**Author:** ![vivekthangathurai](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/vivekthangathurai/32/4919_2.png) [@vivekthangathurai](https://drone.discourse.group/u/vivekthangathurai)\
**Post date:** [February 23, 2020, 8:29am UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/8 "2020-02-23T08:29:54Z")

</div>

I have the following configuration

```auto
kind: pipeline
type: docker
name: default

steps:
- name: backend
  image: golang
  commands:
  - go build
  - go test

- name: docker
  image: plugins/docker
  repo: vivek125/simplego
  registry: docker.io
  username:
    from_secret: docker_username
  password:
    from_secret: docker_password
  auto_tag: true
  when:
    branch: master

```

and the repo is not used in the tag  
Successfully built 6da4610ad6be  
111 Successfully tagged 39d097259173f9fb3945e1d3b2fd8cb99b81b1dc:latest  
112 + /usr/local/bin/docker tag 39d097259173f9fb3945e1d3b2fd8cb99b81b1dc :latest  
113 Error parsing reference: “:latest” is not a valid repository/tag: invalid reference format

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 23, 2020, 7:54pm UTC](https://drone.discourse.group/t/build-fails-when-using-auto-tag-in-docker-plugin/11049/9 "2020-02-23T19:54:13Z")

</div>

All plugin configuration parameters need to go under the `settings` section which is missing from your configuration. See the [plugin docs](http://plugins.drone.io/drone-plugins/drone-docker/) for some example configurations.
