Support tag not semantic version when using docker plugin auto_tag

Hi, all

I use plugins/docker to build docker image, but i found the image the final tag is 0.1.0-alpha1 when my tag like v0.1.0-alpha1, i hope the docker plugin use v0.1.0-alpha1 as image tag.

I don’t know why the docker plugin not support it, because i remember plugin support it before. Maybe i missing something, so if someone know, hope can tell me. Thanks.

auto-tagging strips the “v” from the tag prefix.

Yes, i see the docker plugin code, it use semantic version.
I use tags parameter, like this tags: [ "${DRONE_TAG}" ], the docker plugin not works. But when i add debug: true, it works. I don’t know why.

If you are using auto_tag you should not be settings tags manually.

Here is an example of how we use auto_tag for drone

Thanks, I remove tags and only use auto_tag, it’s OK. if my tag is v0.1.0, the image tag is 0.1.0, but I hope the image tag is the same as git tag, so I try the tags, but if I not set debug, it’s not work.

auto-tag is very opinionated and uses best practices for tagging images, based on how the official dockerhub images are tagged. Auto-tag therefore may not be a good fit for every project.

auto-tag is good, but i have some project use not semantic version use as git tag, so i can’t use this configuration, i have to use tags instead of auto_tag, but when i use tags, it not work.

- name: build
    dockerfile: Dockerfile
    force_tag: true
    insecure: true
      from_secret: docker_password
    - "${DRONE_TAG}"
      from_secret: docker_username
  privileged: true
    - tag

If i want this pipeline works, i must setting debug: true in settings, i don’t know where is wrong. Can you tell me if you have time?

I also can’t get regular tags to work with this. @bradrydzewski I assume you are busy, but would you know why?


- name: deploy-tag
    image: plugins/docker
        - ${DRONE_TAG}
      repo: otomi/nodejs-helloworld
        from_secret: REGISTRY_USERNAME
        from_secret: REGISTRY_PASSWORD
      target: prod
        - otomi/nodejs-helloworld:master
        - tag

I do not have enough detail to advise why it would not be working for you, however, I setup a simple yaml [1] that defines tags and then I ran the build [2] and it used the tags as expected. Manually defining tags in the yaml is a widely used feature – most projects do not use autotag.

Here is the sample yaml that defines the tags:

kind: pipeline
type: docker
name: default

  - name: build
    image: plugins/docker
    pull: if-not-exists
      dry_run: true
      repo: foo/bar
      - latest
      - ${DRONE_BRANCH}

And if you look at the logs [2] you can see that it tags the image accordingly:

+ docker tag d4b8902ca3fc12b4b48fbd3e9dcd267c357aa92b foo/bar:latest
+ docker tag d4b8902ca3fc12b4b48fbd3e9dcd267c357aa92b foo/bar:master