Coder Social home page Coder Social logo

bstick12 / pack-concourse-resource Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 8.0 21 KB

Concourse Resource that uses Pack CLI to build container images

Dockerfile 18.57% Makefile 7.05% Shell 74.38%
oci-image concourse-resource cnb cloud-native-buildpacks

pack-concourse-resource's Introduction

Pack CLI Concourse Resource

You should probably look at using the lifecycle-build task instead of this resource.


A proof of concept concourse resource that builds OCI images using the pack-cli

Uses Docker in Docker so must be run a privileged.

It borrows heavily from the docker-image-resource

It utilizes the in and check behaviours from the registry-image-resource

Currently will only work with buildpacks that are build using pack > v0.0.9

Source Configuration

  • repository: Required. The name of the repository that you want to build e.g bstick12/built-with-pack
  • tag: Optional. The tag value for the image. Defaults to latest
  • username: Required. The username to authenticate with when pushing
  • password: Required. The password to use when authenticating

Behaviour

check: Discover new digests

See registry-image-resource/check

in: Fetch the image's rootfs and metadata

See registry-image-resource/in

out: Build an OCI image using the pack CLI and push to a repository

Parameters

  • build: Required. The source code to build in to the OCI image.
  • builder: Optional. The builder to use to build the OCI image.
  • tag: Optional. Name of tag. Defaults to latest. Overridden by tag_file.
  • tag_file: 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.

Example

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

- name: pack-built-image
  type: pack-image-resource
  source:
    repository: ((image-name))
    email: ((docker-hub-email))
    username: ((docker-hub-username))
    password: ((docker-hub-password))

resource_types:
- name: pack-image-resource
  type: docker-image
  privileged: true
  source:
    repository: bstick12/pack-concourse-resource
    version: latest

jobs:
- name: build-source-using-pack-image-resource
  plan:
  - get: git-resource
    trigger: true
  - put: pack-built-image
    params:
      build: pack-built-image
      builder: ((pack-builder-image))

pack-concourse-resource's People

Contributors

drnic avatar srwaggon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pack-concourse-resource's Issues

Re-release image with pack 0.3.0

$ docker run -ti --entrypoint "" bstick12/pack-concourse-resource pack version
v0.1.0 (git sha: e1793ab9fc3d172a416183ef3df20daf089eba19)

Could the image please be updated with pack 0.3.0?

ERRO[0000] failed to resolve name: could not parse reference

Any ideas why this resource might be failing after its successfully created the image?

image

build url https://ci2.starkandwayne.com/teams/drnic/pipelines/sample-app-nodejs/jobs/build-image/builds/9

When I run the resulting image it works just fine:

docker run -ti -p 8080:8080 starkandwayne/sample-app-nodejs

My simple pipeline to reproduce the error:

resources:
- name: git
  type: git
  source:
    uri: https://github.com/starkandwayne/sample-app-nodejs.git
- name: image
  type: pack-image-resource
  source:
    password: ((docker-hub-password))
    repository: starkandwayne/sample-app-nodejs:latest
    username: ((docker-hub-username))
resource_types:
- name: pack-image-resource
  type: docker-image
  source:
    repository: bstick12/pack-concourse-resource
  privileged: true
jobs:
- name: build-image
  plan:
  - get: git
    trigger: true
  - put: image
    params:
      build: git
      builder: cloudfoundry/cnb:cflinuxfs3

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.