github.com/kubesphere/s2irun@v3.2.1+incompatible/README.md (about) 1 ## S2IRun 2 [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/kubesphere/s2irun) 3 [![License](http://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/KubeSphere/s2irun/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/kubesphere/s2ioperator)](https://goreportcard.com/report/github.com/kubesphere/s2irun) [![S2IRun release](https://img.shields.io/github/release/kubesphere/s2irun.svg?color=release&label=release&logo=release&logoColor=release)](https://github.com/kubesphere/s2irun/releases/tag/v0.0.3) 4 ![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/s2irun) 5 6 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. 7 8 You've just built and run a new container image from source code in a git repository, no Dockerfile necessary. 9 10 ## Quick start 11 12 #### Prerequisites 13 14 - [golang](https://golang.org/dl/) environment 15 - [docker](https://docs.docker.com/install/) version 17.03+. 16 17 #### Start 18 19 1. Create your own fork of [devops-java-sample](https://github.com/kubesphere/devops-java-sample), this is a web project with java8. 20 21 2. Clone [S2IRun repo](https://github.com/kubesphere/s2irun) to your machine 22 23 3. Write a config file to set parameters used in build: 24 25 ```json 26 { 27 "builderImage": "kubesphere/java-8-centos7:v2.1.0", 28 "pushAuthentication": { 29 "username": "USERNAME_REPLACE", 30 "password": "PASSWORD_REPLACE" 31 }, 32 "imageName": "USERNAME_REPLACE/s2irun-sample", 33 "tag": "USERNAME_REPLACE/s2irun-sample:tag", 34 "builderPullPolicy": "if-not-present", 35 "export": true, 36 "sourceUrl": "https://github.com/GIT_USERNAME_REPLACE/devops-java-sample.git", 37 } 38 ``` 39 40 4. To build image in right, you'll need to set environment variables: 41 42 ```shell 43 export S2I_CONFIG_PATH=PATH/TO/config.json 44 ``` 45 46 5. Run following command to start build. 47 48 ``` 49 go run cmd/main.go --v=4 --logtostderr=true 50 ``` 51 52 Process details: 53 54 1. It will pull image that defined in field `builderImage`. 55 56 2. clone source code. 57 58 3. start build process 59 60 4. after build completed, it will push ready-to-run image 61 62 6. Finally, it will push image to your docker registry, please check it. 63 64 ## About more 65 66 - See [CONTRIBUTING](https://github.com/kubesphere/kubesphere/blob/master/docs/en/guides/Development-workflow.md) for an overview of our processes 67 - Guidance for [S2I builder image](docs/builder_image.md) creators