Setup manifest Plugin

Greetings everyone!

Im trying to setup the drone manifest plugin:

Unfortunately i couldnt make if work. Im sure im missing some really simple steps or thinks i didnt understand correctly.

Im building 3 Images for different architectures and then i want to publish an manifest containing those to my registry.

My pipeline looks like this:

kind: pipeline
type: docker
name: build-arm64

platform:
  os: linux
  arch: arm64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      tags: latest
      auto_tag_suffix: linux-arm64
      auto_tag: true
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/test
      registry: 192.168.178.39:5000
---
kind: pipeline
type: docker
name: build-arm32
platform:
  os: linux
  arch: arm

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      tags: latest
      auto_tag_suffix: linux-arm
      auto_tag: true
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/test
      registry: 192.168.178.39:5000

---
kind: pipeline
type: docker
name: build-amd64
platform:
  os: linux
  arch: amd64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      tags: latest
      auto_tag_suffix: linux-amd64
      auto_tag: true
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/test
      registry: 192.168.178.39:5000

---
kind: pipeline
type: docker
name: manifest
platform:
  os: linux
  arch: arm64

steps:
  - name: manifest
    image: plugins/manifest
    settings:
      target: sf/test:latest
      template: sf/test:latest-OS-ARCH
      ignore_missing: true
      platforms:
        - linux/amd64
        - linux/arm64
        - linux/arm

depends_on:
  - build-arm64
  - build-arm32
  - build-amd64

What do i expect the pipeline to do:

  • Build 3 Docker images ← working
  • Tag them like this “user/project:latest-ARCH-OS” e.g. “sf/test:lastest-linux-arm64”
  • Create an manifest containing those 3 Images
  • Push everything to my private registry

Error description:

latest: Pulling from plugins/manifest
2 Digest: sha256:05930eefaba35a6f1a4225b3ce2cbb6a71ed31d02995d83e49c8b4ec4a3e78a7
3 Status: Image is up to date for plugins/manifest:latest
4 2021/03/25 17:58:13 pushing sf/test:latest-OS-ARCH to sf/test:latest for linux/amd64, linux/arm64, linux/arm
5 time="2021-03-25T17:58:15Z" level=warning msg="Couldn't find or access image reference \"sf/test:latest-linux-amd64\". Skipping image."
6 time="2021-03-25T17:58:18Z" level=warning msg="Couldn't find or access image reference \"sf/test:latest-linux-arm64\". Skipping image."
7 time="2021-03-25T17:58:20Z" level=warning msg="Couldn't find or access image reference \"sf/test:latest-linux-arm\". Skipping image."
8 time="2021-03-25T17:58:20Z" level=fatal msg="all entries were skipped due to missing source image references; no manifest list to push"
9 2021/03/25 17:58:20 exit status 1

It looks like the plugin cant find the created images and i dont understand why.

Is it because the tag is wrong or are there restrictions and the plugin cant access the images?

The documentation is pretty small and i couldnt find any threads related to this on SO.

If someone had similar problems or can provide me with an basic example would be great. Any help would be appreciated.

Thank you very much :slight_smile:

Time passes by and i tried different things without success, tho.

The more things i test, the more im getting confused. Im clearly missing something…

Refering to:
http://plugins.drone.io/drone-plugins/drone-docker/

" When the event type is push and the target branch is your default branch (e.g. master) the plugin will automatically tag the image as latest . All other event types and branches are ignored."

With this example:

steps:
- name: docker  
  image: plugins/docker
  settings:
    repo: foo/bar
    auto_tag: true
    auto_tag_suffix: linux-amd64
    username: kevinbacon
    password: pa55word

I realized that i can’t use “tags” and “auto_tag” at the same time, cuz of this i removed “tag” and tried to use the auto_tag feature.

My current pipeline:

kind: pipeline
type: docker
name: build-arm64

platform:
  os: linux
  arch: arm64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      auto_tag: true
      auto_tag_suffix: linux-arm64
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/test
      registry: 192.168.178.39:5000
---
kind: pipeline
type: docker
name: build-amd64

platform:
  os: linux
  arch: amd64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      auto_tag: true
      auto_tag_suffix: linux-amd64
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/test
      registry: 192.168.178.39:5000

---
kind: pipeline
type: docker
name: manifest

platform:
  os: linux
  arch: arm64

steps:
  - name: manifest
    image: plugins/manifest
    settings:
      target: sf/test:latest
      template: sf/test:latest-OS-ARCH
      ignore_missing: true
      platforms:
        - linux/amd64
        - linux/arm64

depends_on:
  - build-arm64
  - build-amd64

If i understand this correctly, there shoule be a tag like “latest-linux-amd64” but my image gets tagged like this:

Imho there is “latest” missing. Even with a tag like “latest-linux-amd64” it would not be the desired result.

What is the goal:

Be able to pull the image by refering to “latest” and get the right image for the right os:

e. g. “docker pull test”

  • on an amd64 machine should pull the amd-64 image
  • on an arm64 machine should pull the arm-64 image

What have i tried:

  1. remove the “auto_tag_suffix” statement → the last published image overwrites the others

  2. added the full path to my registry in the plugin/manifest section:
    target: 192.168.178.39:5000/sf/test:latest
    template: 192.168.178.39:5000/sf/test:latest-OS-ARCH
    → manifest plugin cant find the referenced images and doesnt publish a manifest cuz there are no image entries

  3. Tried with auto_tag and the path mentioned in 2. → cant find or access image

  4. Tried with auto_tag but only put the full path in “target” → cant find or access image

  5. I took a look at the .drone.yml in the drone github repository but it is using a specs file and i would like to avoid this and in the begining only build new “latest” images

  6. removed “auto_tag” and “auto_tag_suffix”, added “tags: - latest-linux-amd64” with the full path in the plugin/manifest like 4. → cant find or access image

  7. removed “auto_tag” and “auto_tag_suffix”, added “tags: - latest-linux-amd64” without the full path, only: sf/test → cant find or access image

  8. nearly every variant of the mentioned above steps

Im pretty sure that this somehow possible and it looks like other people make it work because i couldnt find any thread related to this. The documentation doesnt provide enough information, at least for me, to understand what i’m doing wrong and whats the solution.

  1. Is it possible to use the manifest plugin with an private registry?
  2. How can i figure out why the manifest/plugin doesnt find the fresh build images?
  3. Is “target” in the manifest plugin refering to the full path to the registry: 192.168.178.39:5000/sf/test:latest
  4. Why is there no “latest” in the tag for the fresh build image
  5. How can i build several images for different platforms, and publish them all together under “latest”

I’m grateful for any hints :slight_smile: I feel like i hit a dead end :smiley:

@simann,

I have tested with docker private repo and can see all three architecture is pushed under latest tag with diffrent OS/ARCH, I am not sure on private registry that I need to check and confirm.
I have used dockerhub-username/dockerrepo in target.
Below is the yaml file used by me:
kind: pipeline
type: kubernetes
name: default

steps:

  • name: manifest
    image: plugins/manifest
    settings:
    username:
    from_secret: docker_username
    password:
    from_secret: docker_password
    target: dockerhub-username/dockerrepo
    template: dockerhub-username/dockerrepo:testapp
    platforms:
    - linux/amd64
    - linux/arm
    - linux/arm64

You can find more details in below doc:
http://plugins.drone.io/drone-plugins/drone-manifest/

Regards,
Harness Support

I will test it again today/tomorrow.

Could you provide me the full yaml file? In the file above there is only the manifest plugin mentioned?

Maybe a basic example with the docker plugin in combination with the manifest plugin?

My other solution is to give my builds static tags in the builder and reference in my compose file where i want these images to run with the full tag. Thats my last resort :slight_smile:

most of the drone repositories use the manifest plugin to publish multi-platform manifests. Here are some real world yaml files that you can study:

I havent been able to solve this with the plugin, but i have an workaround!

The images are build, and pushed correct the only thing i was missing was the
manifest.

The last step of my build pipeline creates the manifest via command line.

i might could have used an exec runner but i decided to use the dind image.

This is my yaml file:

kind: pipeline
type: docker
name: build-arm64

platform:
  os: linux
  arch: arm64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      auto_tag: true
      auto_tag_suffix: linux-arm64
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/frontend
      registry: 192.168.178.39:5000
---
kind: pipeline
type: docker
name: build-amd64

platform:
  os: linux
  arch: amd64

steps:
  - name: install and build
    image: node:14
    pull: if-not-exists
    commands:
      - npm install
      - npm run build

  - name: build docker image
    image: plugins/docker
    pull: if-not-exists
    settings:
      auto_tag: true
      auto_tag_suffix: linux-amd64
      insecure: true
      dockerfile: docker/Dockerfile
      repo: 192.168.178.39:5000/sf/frontend
      registry: 192.168.178.39:5000
---
kind: pipeline
type: docker
name: manifest

services:
  - name: docker
    image: docker:dind
    privileged: true
    volumes:
      - name: dockersock
        path: /var/run

steps:
  - name: create and push manifest
    image: docker:dind
    volumes:
      - name: dockersock
        path: /var/run
    commands:
      - docker manifest create --insecure 192.168.178.39:5000/sf/frontend:latest 192.168.178.39:5000/sf/frontend:linux-amd64 192.168.178.39:5000/sf/frontend:linux-arm64
      - docker manifest push --insecure 192.168.178.39:5000/sf/frontend:latest

volumes:
  - name: dockersock
    temp: {}

depends_on:
  - build-arm64
  - build-amd64

Big thanks to @bradrydzewski and @csgit for your help and effort :slight_smile: