s2irun

module
v3.2.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2022 License: Apache-2.0

README

S2IRun

Gitpod ready-to-code License Go Report Card S2IRun release Docker Pulls

Source to image is a command toolkit and workflow for building reproducible container images from source code. S2IRun is the instance that executes the s2i build process, and can be containerized so that it can run in any container environment. S2IRun produces ready-to-run images by injecting source code into a container image and letting the container prepare that source code for execution.

You've just built and run a new container image from source code in a git repository, no Dockerfile necessary.

Quick start

Prerequisites
Start
  1. Create your own fork of devops-java-sample, this is a web project with java8.

  2. Clone S2IRun repo to your machine

  3. Write a config file to set parameters used in build:

    {
      "builderImage": "kubesphere/java-8-centos7:v2.1.0",
      "pushAuthentication": {
        "username": "USERNAME_REPLACE",
        "password": "PASSWORD_REPLACE"
      },
      "imageName": "USERNAME_REPLACE/s2irun-sample",
      "tag": "USERNAME_REPLACE/s2irun-sample:tag",
      "builderPullPolicy": "if-not-present",
      "export": true,
      "sourceUrl": "https://github.com/GIT_USERNAME_REPLACE/devops-java-sample.git",	                                  
    }
    
  4. To build image in right, you'll need to set environment variables:

    export S2I_CONFIG_PATH=PATH/TO/config.json
    
  5. Run following command to start build.

    go run cmd/main.go --v=4 --logtostderr=true
    

    Process details:

    ​ 1. It will pull image that defined in field builderImage.

    ​ 2. clone source code.

    ​ 3. start build process

    ​ 4. after build completed, it will push ready-to-run image

  6. Finally, it will push image to your docker registry, please check it.

About more

Directories

Path Synopsis
pkg
api
Package api provides types used for processing s2i builds.
Package api provides types used for processing s2i builds.
api/constants
Package constants provides constants used across s2i.
Package constants provides constants used across s2i.
docker
Package docker implements Docker operations used by the S2I builder and executor.
Package docker implements Docker operations used by the S2I builder and executor.
run
scm
tar
utils/bytefmt
Package bytefmt contains helper methods and constants for converting to and from a human-readable byte format.
Package bytefmt contains helper methods and constants for converting to and from a human-readable byte format.
utils/status
Package status provides functionality to update the status of a build with information about failures that occurred.
Package status provides functionality to update the status of a build with information about failures that occurred.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL