docker / app

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

Image tag #652

Closed eunomie closed 4 years ago

eunomie commented 4 years ago

- What I did

Add a docker app image tag command

$ docker image tag --help

Usage:  docker image tag SOURCE_APP_IMAGE[:TAG] TARGET_APP_IMAGE[:TAG]

Create a tag TARGET_APP_IMAGE that refers to SOURCE_APP_IMAGE

Also two small fixup on tests and insecureRegistriesFromEngine.

- How I did it

Read a bundle from the bundle store and store it again on a new reference.

- How to verify it

A complete scenario is provided as end to end test and some unit tests are covering the command.

To verify it locally, by hand:

  1. bundle an image with a tag and be sure the image exists in the store

    docker app bundle --tag hello-world example-hello-world.dockerapp

    $ docker app image ls
    IMAGE NAME         APP NAME
    hello-world:latest hello-world
  2. tag the image with a new name. Without explicit tag, latest will be used

    docker app image tag hello-world bonjour-monde

    $ docker app image ls
    IMAGE NAME           APP NAME
    bonjour-monde:latest hello-world
    hello-world:latest   hello-world
  3. specify a destination tag

    docker app image tag hello-world hello-world:0.1

    IMAGE NAME           APP NAME
    bonjour-monde:latest hello-world
    hello-world:0.1      hello-world
    hello-world:latest   hello-world
  4. specify the source tag

    docker app image tag hello-world:0.1 bonjour:0.3

    $ docker app image ls
    IMAGE NAME           APP NAME
    bonjour:0.3          hello-world
    bonjour-monde:latest hello-world
    hello-world:0.1      hello-world
    hello-world:latest   hello-world

- Description for the changelog

Add a docker app image tag command.

codecov[bot] commented 4 years ago

Codecov Report

Merging #652 into master will increase coverage by 0.17%. The diff coverage is 86.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #652      +/-   ##
==========================================
+ Coverage   71.67%   71.85%   +0.17%     
==========================================
  Files          51       52       +1     
  Lines        2616     2643      +27     
==========================================
+ Hits         1875     1899      +24     
- Misses        498      500       +2     
- Partials      243      244       +1
Impacted Files Coverage Δ
internal/commands/root.go 72.11% <0%> (ø) :arrow_up:
internal/commands/image/command.go 100% <100%> (ø) :arrow_up:
internal/commands/image/tag.go 88.23% <88.23%> (ø)
internal/yaml/yaml.go 80% <0%> (-3.34%) :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 350ab29...1d919ae. Read the comment docs.