Choosing Language and Version
JFrog Pipelines supports Java, C++, Node.js, .NET,, and Go programming languages out of the box. JFrog provides default images in a standardruntime images library, which already have the latest language versions pre-installed. You can use Pipelines to build with other languages by providing a custom image, or installing the language version you need as part of youronStartconfiguration.
In theruntime
section of your YAML configuration you can specify alanguage
andversion
, which Pipelines will use to select the matching language image. This setting can be configured at apipeline
orstep
level. As an example, pipeline level configuration is shown below:
pipelines: - name: pipeline_1 configuration: runtime: type: image image: auto: language: node version: "16" # Either "version" or "versions" can be used. versions: - "16"
Tag | Description |
---|---|
language |
Can be set to:
|
version |
Can be set to a singleversion of the language you want to run your build against. Remember to put the version in double quotes, since the parser expects a string. For example: "9.0.0". 支持版本的信息,请参阅Runtime Images. |
versions |
Can be set tomultipleversionsof the language you want to run your build against. Remember to put the version in double quotes, since the parser expects a string. For example: "9.0.0". |
If you need an unsupported version of a language, you can either install it in theonStart
section, or use a custom Docker image.
Using a Custom Runtime Image
In some cases, our standard images library might not satisfy your requirements, or you might have an internal image you want to use for step execution.Using your own custom imagegives you better control over what is installed on the runtime images.It can also speed up step execution since you can pre-install dependencies into the image.
You can configure a custom runtime image by using the configuration shown below. This can be specified at a pipeline or step level. If specified at both levels, the step configuration will take precedence.
pipelines: - name: pipe1 configuration: runtime: type: image image: custom: name:# imageRepo/imageName format tag: # version tag of the initial version of the Docker image options: "-e HOME=/root" # Docker options autoPull: # default true; pulls image before run registry: # if custom image is private, an integration is required for authentication sourceRepository: # may be required if registry is Artifactory. e.g. docker-local region: # required if registry is AWS. e.g. us-east-1
Tag | Description |
---|---|
name |
This is the fully qualified name of the Docker image. |
tag |
This is the Docker image tag you want to use. |
options |
This is any Docker option you want to use in thedocker run command. You also need to include the$HOME environment variable as shown if it is not already set in your image. |
autopull |
This is an option to automatically pull the image to the machine running the step. Defaults totrue . |
If your custom image is private, you will also need to create an integration with credentials for your Docker registry, and set additional values in the config:
Tag | Description |
---|---|
registry |
This is the friendly name of your Docker registry integration. Supported integration types areArtifactory,Docker Registry,AWS Keys, andGoogle Cloud. |
sourceRepository |
The is not used with JFrog CLI v2. This is only needed if your Docker registry is Artifactory and the pipeline is configured to use JFrog CLI v1. It is the name of the Docker registry on Artifactory. |
region |
This is only required if your Docker registry is AWS ECR. |
Examples
Example1
pipelines: - name: pipe1 configuration: runtime: type: image image: custom: name: docker/jfrog_win tag: latest options: "-e HOME=/root" autoPull: false registry: PSSG_DockerRegistry
Example 2 - Artifactory registry
pipelines: - name: pipe2 configuration: runtime: type: image image: custom: name: ubuntu tag: latest registry: myArtifactory sourceRepository: docker-local
Example 3 - AWS registry
pipelines: - name: pipe3 configuration: runtime: type: image_aws image: custom: name: 541601.dkr.ecr.us-east-1.amazonaws.com/jfbeta tag: latest autoPull: false registry: AWS region: us-east-1
Minimum Requirements for Linux
任何自定义运行时图像指定的步骤will run in a Linux host node (Ubuntu, CentOS, or RHEL) needs to include this minimum set of components:
- bash
- /proc/sys/kernel/random/uuid
- sed
- GNU grep
- ssh
- coreutils
- date
- mkdir
- cp
- mv
- touch
- seq
- cat
- basename (for users usingsend_notification (email)command)
- rm
- uniq (for users usingcompare_gitcommand)
- split (for users usingencrypt_string,decrypt_string,encrypt_file,decrypt_filecommands)
- jfrog (when using an Artifactory integration or in a native step)
- jq
- awk (for users usingcompare_gitcommand)
- git (for users usingcompare_gitcommand or GitRepo resources))
- gettext (for users usingreplace_envs,send_notification (email)commands)
- envsubst
- curl (for users usingsend_notificationcommand)
- base64 (for users usingsend_notification (email),encrypt_string,decrypt_string,encrypt_file,decrypt_filecommands)
- openssl (for users usingencrypt_string,decrypt_string,encrypt_file,decrypt_filecommands)
Minimum Requirements for Windows Server
任何自定义运行时图像指定的步骤will run in a Windows Server host node needs to include this minimum set of components:
- PowerShell 5
- jq(for users usingreplicate_resource or send_notificationcommands)
- git (for users usingcompare_gitcommand or GitRepo resources)
- openssl (for users usingencrypt_string,decrypt_string,encrypt_file,decrypt_filecommands)