Drone

Some problem with docker build and tag

Suddenly encountered a problem. When we use the old pipiline syntax style, everything is fine.

pipeline:
  docker-build-publish:
    image: plugins/docker
    dockerfile: Dockerfile
    repo: somerepo/app
    auto_tag: true
    secrets: [ docker_username, docker_password ]
    when:
      branch: master

But if we use pipeline like at documentation examples.

kind: pipeline
type: docker
name: default
steps:
- name: docker-build-publish
  image: plugins/docker
  dockerfile: Dockerfile
  repo: somerepo/app
  # use_cache: true
  auto_tag: true
  secrets: [ docker_username, docker_password ]
  when:
    branch: master

We catch an error

Successfully tagged 42ebdf2efre339ff918e7d2b8af1537a2da7a742:latest
1031	+ /usr/local/bin/docker tag 42ebdf2efre339ff918e7d2b8af1537a2da7a742 :latest
1032	Error parsing reference: ":latest" is not a valid repository/tag: invalid reference format
1033	time="2019-11-01T08:01:13Z" level=fatal msg="exit status 1"

the syntax you are using does not match the documentation. please see the following for the correct plugin syntax:
http://plugins.drone.io/drone-plugins/drone-docker/

1 Like

Thank you :grinning: