Coder Social home page Coder Social logo

docker-image-resource's Introduction

Docker Image Resource

Tracks and builds Docker images.

Note: docker registry must be v2.

Source Configuration

  • repository: Required. The name of the repository, e.g. concourse/docker-image-resource.

    Note: When configuring a private registry, you must include the port (e.g. :443 or :5000) even though the docker CLI does not require it.

  • tag: Optional. The tag to track. Defaults to latest.

  • username: Optional. The username to authenticate with when pushing.

  • password: Optional. The password to use when authenticating.

  • aws_access_key_id: Optional. AWS access key to use for acquiring ECR credentials.

  • aws_secret_access_key: Optional. AWS secret key to use for acquiring ECR credentials.

  • insecure_registries: Optional. An array of CIDRs or host:port addresses to whitelist for insecure access (either http or unverified https). This option overrides any entries in ca_certs with the same address.

  • registry_mirror: Optional. A URL pointing to a docker registry mirror service.

  • ca_certs: Optional. An array of objects with the following format:

    ca_certs:
    - domain: example.com:443
      cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    - domain: 10.244.6.2:443
      cert: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----

    Each entry specifies the x509 CA certificate for the trusted docker registry residing at the specified domain. This is used to validate the certificate of the docker registry when the registry's certificate is signed by a custom authority (or itself).

    The domain should match the first component of repository, including the port. If the registry specified in repository does not use a custom cert, adding ca_certs will break the check script. This option is overridden by entries in insecure_registries with the same address or a matching CIDR.

Behavior

check: Check for new images.

The current image digest is fetched from the registry for the given tag of the repository.

in: Fetch the image from the registry.

Pulls down the repository image by the requested digest.

The following files will be placed in the destination:

  • /image: If save is true, the docker saved image will be provided here.
  • /repository: The name of the repository that was fetched.
  • /tag: The tag of the repository that was fetched.
  • /image-id: The fetched image ID.
  • /digest: The fetched image digest.
  • /rootfs.tar: If rootfs is true, the contents of the image will be provided here.
  • /metadata.json: Collects custom metadata. Contains the container env variables and running user.
  • /docker_inspect.json: Output of the docker inspect on image_id. Useful if collecting LABEL metadata from your image.

Parameters

  • save: Optional. Place a docker saved image in the destination.
  • rootfs: Optional. Place a .tar file of the image in the destination.
  • skip_download: Optional. Skip docker pull of image. Only /image-id, /repository, and /tag will be populated. /image and /rootfs.tar will not be present.

out: Push an image, or build and push a Dockerfile.

Push a Docker image to the source's repository and tag. The resulting version is the image's digest.

Parameters

  • build: Optional. The path of a directory containing a Dockerfile to build.

  • load: Optional. The path of a directory containing an image that was fetched using this same resource with save: true.

  • dockerfile: Optional. The path of the Dockerfile in the directory if it's not at the root of the directory.

  • cache: Optional. Default false. When the build parameter is set, first pull image:tag from the Docker registry (so as to use cached intermediate images when building). This will cause the resource to fail if it is set to true and the image does not exist yet. Note: Since docker 1.10 docker images do not contain all necessary metadata to restore the build cache. Additional metadata needs to be saved and re-applied after a docker pull to have subsequent builds skip identical intermediate layers. This additional metadata is stored as a very small separate image (image:${cache_tag}-buildcache) in the repository of this resource.

  • cache_tag: Optional. Default tag. The specific tag to pull before building when cache parameter is set. Instead of pulling the same tag that's going to be built, this allows picking a different tag like latest or the previous version. This will cause the resource to fail if it is set to a tag that does not exist yet.

  • load_base: Optional. A path to a directory containing an image to docker load before running docker build. The directory must have image, image-id, repository, and tag present, i.e. the tree produced by /in.

  • load_file: Optional. A path to a file to docker load and then push. Requires load_repository.

  • load_repository: Optional. The repository of the image loaded from load_file.

  • load_tag: Optional. Default latest. The tag of image loaded from load_file

  • import_file: Optional. A path to a file to docker import and then push.

  • pull_repository: Optional. A path to a repository to pull down, and then push to this resource.

  • pull_tag: Optional. Default latest. The tag of the repository to pull down via pull_repository.

  • tag: Optional. The value should be a path to a file containing the name of the tag.

  • tag_prefix: Optional. If specified, the tag read from the file will be prepended with this string. This is useful for adding v in front of version numbers.

  • tag_as_latest: Optional. Default false. If true, the pushed image will be tagged as latest in addition to whatever other tag was specified.

  • build_args: Optional. A map of Docker build arguments.

    Example:

    build_args:
      do_thing: true
      how_many_things: 2
      email: [email protected]
  • build_args_file: Optional. Path to a JSON file containing Docker build arguments.

    Example file contents:

    { "email": "[email protected]", "how_many_things": 1, "do_thing": false }

Example

resources:
- name: git-resource
  type: git
  source: # ...

- name: git-resource-image
  type: docker-image
  source:
    repository: concourse/git-resource
    username: username
    password: password

- name: git-resource-rootfs
  type: s3
  source: # ...

jobs:
- name: build-rootfs
  plan:
  - get: git-resource
  - put: git-resource-image
    params: {build: git-resource}
    get_params: {rootfs: true}
  - put: git-resource-rootfs
    params: {file: git-resource-image/rootfs.tar}

docker-image-resource's People

Contributors

aquavitae avatar bugroger avatar cdutra avatar d avatar databus23 avatar drnic avatar endzyme avatar evashort avatar gregarcara avatar kichik avatar kris-runzer avatar lnguyen avatar mariash avatar mason-jones-ck avatar mhoran avatar mook-as avatar nopik avatar o-orand avatar oppegard avatar pixeleet avatar robdimsdale avatar sclevine avatar shinji62 avatar vito avatar xoebus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.