docker / app

Make your Docker Compose applications reusable, and share them on Docker Hub
Apache License 2.0
1.57k stars 176 forks source link

Use relocation map on fixup #748

Closed eunomie closed 4 years ago

eunomie commented 4 years ago

- What I did

When we are doing the fixup of a bundle, apply relocation map when necessary.

Previous behaviour:

The goal of this commit is to add one more condition, to copy/mount images that has been previously pushed from the local docker image store and so that can be resolved using the relocation map.

So the behaviour looks like:

- How I did it

Use new cnab-to-oci, see https://github.com/docker/cnab-to-oci/pull/82

- How to verify it

The affected workflow is the following:

  1. create a bundle referencing local images. Like after a docker app build
    • the bundle contains images with, by example, Image: web
  2. push it to a registry
  3. pull it (by example on an other machine)
    • the bundle contains Image: web associated to an entry in the relocation map: web: registry/user/repo:tag@sha256...
  4. push it (to an other registry or not)
    • the image web is not resolved in the registry (but the corresponding image has already been pushed)
    • the image cannot be pushed from the local docker image store (the image doesn't exist there)
    • the entry from the relocation maps is resolvable and can be copy or mount

- Description for the changelog

Use relocation map to copy images already present on the registry when pushing a pulled bundled without to have locally all the images.

codecov[bot] commented 4 years ago

Codecov Report

Merging #748 into master will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #748      +/-   ##
==========================================
- Coverage   69.58%   69.56%   -0.02%     
==========================================
  Files          64       64              
  Lines        3567     3568       +1     
==========================================
  Hits         2482     2482              
- Misses        757      758       +1     
  Partials      328      328
Impacted Files Coverage Δ
internal/commands/push.go 34.09% <100%> (+0.5%) :arrow_up:
types/parameters/parameters.go 92.06% <0%> (-1.59%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a49da4...4746133. Read the comment docs.

rumpl commented 4 years ago

Is this still WIP?

eunomie commented 4 years ago

Is this still WIP?

It's waiting for approval on https://github.com/docker/cnab-to-oci/pull/82 (and I will rebase it)