hmake icon indicating copy to clipboard operation
hmake copied to clipboard

Add pull property for pull image instead of build

Open easeway opened this issue 8 years ago • 0 comments

Add pull property to be used in two scenarios:

  1. With build
targets:
    toolchain:
        pull: true
        build: docker/toolchain
        image: local-toolchain:latest

    toolchain-with-different-name:
        pull: evocloud/toolchain:latest
        build: docker/toolchain
        image: local-toolchain:latest

When pull is present (true or with an image) with build, the target will try to pull the image from remote, and re-tag it with name specified by image. If pull failed, it will fallback to build the image locally with build.

  1. Without build
targets:
    build:
        pull: true
        image: toolchain:latest
        cmds:
            - ...
    build-with-different-name:
        pull: evocloud/toolchain
        image: local-toolchain:latest
        cmds:
            - ...

When pull is present without build, the target will try pull the image first before creating the container. The behavior is the same as above, and the image will be tagged with name specified by image.

easeway avatar Jul 20 '17 20:07 easeway