Noelware/docker-manifest-action

Manifest creation fails

r4sas opened this issue · 21 comments

r4sas commented

Hello.
Thank you for your workaround with docker containers merging with manifest.

Lately it start fail when trying to create manifest. Example output can be found here: https://github.com/PurpleI2P/i2pd/actions/runs/4001302421/jobs/6867928655

/usr/bin/docker manifest create --amend purplei2p/i2pd:latest purplei2p/i2pd:latest-amd64 purplei2p/i2pd:latest-i386 purplei2p/i2pd:latest-arm64 purplei2p/i2pd:latest-armv7
docker.io/purplei2p/i2pd:latest-amd64 is a manifest list

How can we fix this?

To be honest, I haven't really seen this error before when testing with the action itself! Can you create a mini repro of this?

The repository mentioned has amend: false but the output provided has the --amend flag, which shouldn't be in the command at all. I'll take a look at this in a bit.

r4sas commented

I can try modify workflow and add amend: false manually if needed.

Please do! If it still continues to error, please tell so I can try to find some solutions!

The action actually forces amend: true in the docker manifest create command and doesn't amend: true in docker manifest push, I'll need to fix that in a few hours (and maybe you can try again when it is pushed?)

r4sas commented

Just tested with amend: false, and looks like it is ignored: https://github.com/PurpleI2P/i2pd/actions/runs/4018882640/jobs/6905044176#step:7:5

r4sas commented

The action actually forces amend: true in the docker manifest create command and doesn't amend: true in docker manifest push, I'll need to fix that in a few hours (and maybe you can try again when it is pushed?)

Ok, I'm waiting.

I have started to work on this in PR #133 (and I'll work on it when I get home).

I just got the issue right now:

I'll need to dive more into this

The issue is that the tag was already merged with linux/amd64 and linux/arm64, not seperately as a single manifest. Maybe using the tags: or platforms: input from docker/build-push-action@v2 as one?

tags: <registry>/<image>
# or
platforms: linux/amd64

instead of

tags: |
   a,
   b
# or
platforms: linux/amd64,linux/arm64

I'm sorry for all the hoops, but this is also really difficult to debug (since I didn't know how to reproduce this), but maybe try that solution or amend: true?

r4sas commented

Not easier for me because linux/arm64 amd linux/armv7 platforms build takes too much time, that's why I build them in separate runner for each platform...

Look at workflow graph to understand: https://github.com/PurpleI2P/i2pd/actions/runs/4001302421

r4sas commented

Untill last week everything works this way:

  • Workflow build every platform in separate runner
  • Uploads them as latest-<arch> tag
  • When all builders finished one more step started, which creates updated tag latest

Not easier for me because linux/arm64 amd linux/armv7 platforms build takes too much time, that's why I build them in separate runner for each platform...

Look at workflow graph to understand: https://github.com/PurpleI2P/i2pd/actions/runs/4001302421

Ah, I see that you only use one platform but multiple tags! I'm really sorry that I made this a bit worse (with a refactor that I been wanting to do for a while, but didn't have the time until now).

I'll try to find a workaround for this, sorry for all the hoops! ;w;

r4sas commented

btw, I think that docker.io make some changes which broken everything...

r4sas commented

And one more link: https://docs.docker.com/engine/reference/commandline/manifest/#create-and-push-a-manifest-list
Example shows that we must use different containers, not tags. But somehow merging of tags worked earlier? Hm...

Hello. I have also encountered this problem and have found a tentative solution, which I will share with you.

The solution is to add provenance: false to docker/build-push-action as follows:

      - name: Build and push Docker image
        uses: docker/build-push-action@v3.3.0
        with:
          context: .
          push: true
          platforms: ${{ matrix.platform }}
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          provenance: false

Related issues may be found here: docker/build-push-action#771

For specific fixes, see the following Pull requests: tomacheese/twitter-dm-memo#31
Action log before modification: https://github.com/tomacheese/twitter-dm-memo/actions/runs/4001345210
Action log after modification: https://github.com/tomacheese/twitter-dm-memo/actions/runs/4002014080

Thank you for a solution! I'll add it to the README and keep this issue open (or not? I don't know in this case)

r4sas commented

@book000 thank you for solution, I'll try it soon.

@auguwu I have question about options names, I agree with extra-images -> inputs change, but why calling output image tag as images?

add:
One more, https://github.com/Noelware/docker-manifest-action#inputs - incorrect warning:

extra-images has been renamed to output

add2:
Maybe change extra-images to images and base-image to target or outputs?

r4sas commented

images
Comma-seperated list of images that will be applied in the merged manifest from the inputs.

Isn't docker manifest create creates new one manifest? I don't think it applies changes to existing, and can read only one output per execution. Current action code supports execution for each target image in list?

@r4sas

add: One more, https://github.com/Noelware/docker-manifest-action#inputs - incorrect warning:

extra-images has been renamed to output

Please see #134 and #136

r4sas commented

Please see #134 and #136

Oops, haven't seen them before, thanks.
In that case, I think this issue can be closed for now.

r4sas commented

The solution is to add provenance: false to docker/build-push-action as follows:

It works. Thank you again.