Dockerfile Linter

POST Parameters

You can find the list with common parameters for all Buddy actions here.

NameTypeDescription
name
Required
StringThe name of the action.
type
Required
StringThe type of the action. Should be set to DOCKERFILE_LINTER.
local_pathStringThe path from which a Dockerfile is chosen.
shell_typeStringType of shell in which the errors will be detected. Available values: sh, bash, dash, ksh
ignore_codesStringThe errors that will be ignored by linter.

List of errors that can be ignored by Linter

CodeDescription
EL0001Invalid line
ED0001All parser directives must be at the very top of a Dockerfile
ED0002Directive appears more then once
ED0003Directives should be lowercase
ED0004Parser directive will be treated as a comment
ED0005Missing value for directive
ER0001Set the SHELL option -o(-eo for Alpine image) pipefail before RUN with a pipe in
ER0002Delete the apt-get lists after installing something
ER0003Use WORKDIR to switch to a directory
ER0004Do not use sudo, consider using gosu
ER0005Command (ssh,shutdown,service,ps,free,top,kill,mount) does not make sense in a container
ER0006Using (apt-get upgrade,dist-upgrade,apk upgrade,apt install) is not recommended
ER0007Either use wget or curl but not both
ER0008Use SHELL to change the default shell
ER0009Use the -y switch
ER0010Avoid additional packages by specifying --no-install-recommends
ER0011Use the --no-cache switch
ER0012Pin versions in apt get install
ER0013Pin versions in pip install
ER0014Pin versions in npm install
ER0015Pin versions in apk add
ER0016Pin versions in gem install
EU0001Last user should not be root
EI0001There can only be one instruction like (CMD,HEALTHCHECK,ENTRYPOINT)
EI0002FROM may only be preceded by one or more ARG
EI0003MAINTAINER is deprecated instead use LABEL
EI0004Don't use (ONBUILD,FROM,MAINTAINTER) in ONBUILD
EI0005Instructions should be uppercase
EF0001Missing FROM
EF0002FROM aliases must be unique
EF0003Using latest is prone to errors if the image will ever update
EF0004Always tag the version of an image explicitly
EC0001COPY --from cannot reference its own FROM alias
EC0002COPY --from should reference a previously defined FROM alias
EC0003Use ADD for extracting archives into a image
EC0004COPY with more then 2 arguments requires the last argument to end with /
EJ0001You must use double-quotes (\") in JSON array
EJ0002CMD and ENTRYPOINT should be written in JSON form
EJ0003SHELL must be written in JSON form
EA0001Use curl or wget instead, and delete files when no longer needed
EA0002Use COPY instead of ADD for files and folders
EW0001Use absolute WORKDIR
EE0001Valid UNIX ports range from 0 to 65535

Example

Request

POST https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions

JSON

{
"name":"linter",
"type":"DOCKERFILE_LINTER",
"trigger_time":"ON_EVERY_EXECUTION",
"trigger_condition":"ALWAYS",
"local_path":"Dockerfile",
"shell_type":"bash",
"ignore_codes":"ER0012,ER0015"
}

Sample Response

HTTP

Status: 201 Created
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

JSON

{ 
  "url":"https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions/2",
 "html_url":"https://app.buddy.works/buddy/company-website/pipelines/pipeline/2/action/2/edit",
  "id":2,
  "name":"linter",
"type":"DOCKERFILE_LINTER",
"trigger_time":"ON_EVERY_EXECUTION",
"last_execution_status":"INITIAL",
"local_path":"Dockerfile",
"shell_type":"bash",
"ignore_codes":"ER0012,ER0015",
"trigger_condition":"ALWAYS",
  "pipeline":{
    "url":"https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2",
    "html_url":"https://app.buddy.works/buddy/company-website/pipelines/pipeline/2",
  "id":2,
"name":"test server",
"trigger_mode":"MANUAL",
"ref_name":"master",
"last_execution_status":"SUCCESSFUL",
"last_execution_revision":"506a3963507943d6908154f4bc9646e829128a08"
}
}