-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Github Action for Copy between registries #762
Comments
We discussed about this with @jedevc. I think we could wrap the |
@crazy-max Isnt keeping the additional functionalities like analysis better in a separate action rather than clubbing everything to one single unit. I assume this combination (build-push, login, metadata, copying) of actions are mostly used in CI systems (both private as well as public) and many of them have their own image analysis tools custom to their need. So I am not sure how we can have a pluggable kind of support in the new proposed action. IMHO, I prefer to keep it simple and just does copying images. |
We definitely should have something in this space, especially now that I think I agree with @akhilerm - splitting up functionality here seems like a good idea. The GitHub action ecosystem is already quite well built for small individual components, and there's already quite a few actions under the I think functionality like analysis, linting, promotion, etc is distinct enough to warrant different actions for this kind of functionality - also, by keeping the scope small, I think we could potentially build an action to do copying quickly, without needing to design a larger architecture that can handle all of the other different pieces. If we're adding more actions, maybe something to be aware of - are we worried about growing the maintenance of components across repositories? Do we need to have a common share library that all of them can pull from, for example, so that we don't need to maintain CI and dev tooling, helper functions, dependabot alerts etc, across multiple repos? @crazy-max we've also discussed this in the context of #746, not sure if you have any more thoughts on this 👀 |
TL;DR:
New link location: https://docs.docker.com/build/ci/github-actions/copy-image-registries/ Reference snippet of relevant content presently rendered at that resource: - name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
user/app:latest
user/app:1.0.0
- name: Push image to GHCR
run: |
docker buildx imagetools create \
--tag ghcr.io/user/app:latest \
--tag ghcr.io/user/app:1.0.0 \
user/app:latest
I have a question as your referenced PR discusses repositories rather than registries?:
Whereas this feature request (with referenced documented action) is not clear to me how it differs from the below approach using - name: 'Prepare tags'
id: prep
uses: docker/[email protected]
with:
images: |
${{ secrets.DOCKER_REPOSITORY }}
${{ secrets.GHCR_REPOSITORY }}
tags: |
type=edge,branch=master
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
- name: 'Build and publish images'
uses: docker/[email protected]
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.prep.outputs.tags }} The Is there a benefit / difference compared to EDIT: I seem to have identified this in below collapsed sections, and summarized in the above TL;DR. Additional referencesdocker/buildx#1137 does reference fixing docker/buildx#486 that notes in Dec 2020
That differs from the Docker docs example where the image name and tags were consistent, with only the registry changing. I assume that's the differentiator? While Thus perhaps the issue title here should be adjusted to reflect that better? Changing the registry shouldn't be an issue if this is the only difference between the two approaches. moby/buildkit#3647 further highlights the intention of docker/buildx#1137 to serve other scenarios where Additional insightsSeems to be confirmed via this maintainer comment (June 2022):
While a PR referencing docker/buildx#1137 uses I am familiar with that multi-arch issue, but for While that may not be viable for some CI workflows if they need to leverage the multi-arch image build / manifest in some manner, I think in 2023 that's also being addressed (might have been with the
As shown above, I'm not sure if bash is necessary? (the Is this just an issue regarding documentation for awareness? Or have I missed something important where that functionality is not served by EDIT: If I understand correctly, the concern is not copying between registries with
For reference, to anyone unaware since this was brought up here, later in Jan 2023 |
The issue is to push one image to multiple registries at the same time. Or to create images with different tags. Suppose an image is available in
Currently
This feature request is not for changes to build-push-action, but create a new action for the functionality mentioned here. Currently its achieved using bash. If we can create a new action for the same, it will help to integrate with other tooling also. |
Let's continue the discussion in docker/actions-toolkit#239. After that being implemented, we could consider a new action to handle |
Currently the copy between registries uses
buildx imagetools
to copy image from one registry to another. Ref.It would be better to have a github action that wraps around this functionality. This also helps in reusing the output of
metadata-action
to create multiple tags, without going through the hassle of using bash to do it in github actions.The text was updated successfully, but these errors were encountered: