2022-07-06 06:08:45 +00:00
< page-header title = "'Build image'" breadcrumbs = "[{label:'Images', link:'docker.images'}, 'Build image']" > < / page-header >
2018-02-28 06:19:06 +00:00
< div class = "row" >
< div class = "col-sm-12" >
< rd-widget >
< rd-widget-body >
< uib-tabset active = "state.activeTab" >
< uib-tab index = "0" >
2020-04-10 21:54:53 +00:00
< uib-tab-heading > < i class = "fa fa-wrench space-right" aria-hidden = "true" > < / i > Builder < / uib-tab-heading >
2018-02-28 06:19:06 +00:00
< form class = "form-horizontal" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Naming < / div >
2018-02-28 06:19:06 +00:00
<!-- names -->
< div class = "form-group" >
2022-01-17 05:53:32 +00:00
< span class = "col-sm-12 text-muted small" > You can specify multiple names to your image. < / span >
2018-02-28 06:19:06 +00:00
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
< label class = "control-label text-left" > Names< / label >
2022-01-17 05:53:32 +00:00
< span class = "label label-default interactive" style = "margin-left: 10px" ng-click = "addImageName()" >
2018-02-28 06:19:06 +00:00
< i class = "fa fa-plus-circle" aria-hidden = "true" > < / i > add additional name
< / span >
< / div >
< / div >
<!-- !names -->
< div class = "form-group" ng-if = "formValues.ImageNames.length === 0" >
< span class = "col-sm-12 text-danger small" >
< i class = "fa fa-exclamation-triangle space-right" aria-hidden = "true" > < / i > You must specify at least one name for the image.
< / span >
< / div >
<!-- name - input - list -->
< div ng-if = "formValues.ImageNames.length > 0" >
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2020-04-10 21:54:53 +00:00
A name must be specified in one of the following formats: < code > name:tag< / code > , < code > repository/name:tag< / code > or
< code > registryfqdn:port/repository/name:tag< / code > format. If you omit the tag the default < b > latest< / b > value is assumed.
2018-02-28 06:19:06 +00:00
< / span >
< / div >
2020-04-10 21:54:53 +00:00
< div class = "form-group" >
2018-02-28 06:19:06 +00:00
< div class = "col-sm-12" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-inline" style = "margin-top: 10px" >
< div ng-repeat = "item in formValues.ImageNames track by $index" style = "margin-top: 2px" >
2018-02-28 06:19:06 +00:00
<!-- name - input -->
< div class = "input-group col-sm-5 input-group-sm" >
< span class = "input-group-addon" > name< / span >
2021-10-14 12:42:10 +00:00
< input type = "text" class = "form-control" ng-model = "item.Name" placeholder = "e.g. my-image:my-tag" auto-focus / >
2020-04-10 21:54:53 +00:00
< span class = "input-group-addon"
2022-06-07 08:42:09 +00:00
>< i ng-class = "{ true: 'fa fa-check green-icon', false: 'fa fa-times red-icon' }[checkName(item.Name)]" aria-hidden = "true" > < /i
2020-04-10 21:54:53 +00:00
>< / span >
2018-02-28 06:19:06 +00:00
< / div >
<!-- !name - input -->
<!-- actions -->
< div class = "input-group col-sm-2 input-group-sm" >
< button class = "btn btn-sm btn-danger" type = "button" ng-click = "removeImageName($index)" >
< i class = "fa fa-trash" aria-hidden = "true" > < / i >
< / button >
< / div >
<!-- !actions -->
< / div >
< / div >
< / div >
< / div >
< / div >
<!-- !name - input - list -->
<!-- build - method -->
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Build method < / div >
2018-02-28 06:19:06 +00:00
< div class = "form-group" > < / div >
2022-01-17 05:53:32 +00:00
< div class = "form-group" style = "margin-bottom: 0" >
2018-02-28 06:19:06 +00:00
< div class = "boxselector_wrapper" >
< div >
2020-04-10 21:54:53 +00:00
< input type = "radio" id = "method_editor" ng-model = "state.BuildType" value = "editor" ng-click = "toggleEditor()" / >
2018-02-28 06:19:06 +00:00
< label for = "method_editor" >
< div class = "boxselector_header" >
2022-07-08 00:57:36 +00:00
< pr-icon icon = "'edit'" feather = "true" > < / pr-icon >
2018-02-28 06:19:06 +00:00
Web editor
< / div >
< p > Use our Web editor< / p >
< / label >
< / div >
< div >
2020-04-10 21:54:53 +00:00
< input type = "radio" id = "method_upload" ng-model = "state.BuildType" value = "upload" ng-click = "saveEditorContent()" / >
2018-02-28 06:19:06 +00:00
< label for = "method_upload" >
< div class = "boxselector_header" >
2022-07-08 00:57:36 +00:00
< pr-icon icon = "'upload'" feather = "true" > < / pr-icon >
2018-02-28 06:19:06 +00:00
Upload
< / div >
< p > Upload a tarball or a Dockerfile from your computer< / p >
< / label >
< / div >
< div >
2020-04-10 21:54:53 +00:00
< input type = "radio" id = "method_url" ng-model = "state.BuildType" value = "url" ng-click = "saveEditorContent()" / >
2018-02-28 06:19:06 +00:00
< label for = "method_url" >
< div class = "boxselector_header" >
2022-07-08 00:57:36 +00:00
< pr-icon icon = "'globe'" feather = "true" > < / pr-icon >
2018-02-28 06:19:06 +00:00
URL
< / div >
2020-05-04 07:54:09 +00:00
< p > Specify a URL to a file< / p >
2018-02-28 06:19:06 +00:00
< / label >
< / div >
< / div >
< / div >
<!-- !build - method -->
<!-- web - editor -->
< div ng-show = "state.BuildType === 'editor'" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Web editor < / div >
2018-02-28 06:19:06 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2020-04-10 21:54:53 +00:00
You can get more information about Dockerfile format in the
< a href = "https://docs.docker.com/engine/reference/builder/" target = "_blank" > official documentation< / a > .
2018-02-28 06:19:06 +00:00
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
< code-editor
identifier="image-build-editor"
placeholder="Define or paste the content of your Dockerfile here"
yml="false"
2020-04-10 21:54:53 +00:00
on-change="(editorUpdate)"
2018-02-28 06:19:06 +00:00
>< / code-editor >
< / div >
< / div >
< / div >
<!-- !web - editor -->
<!-- upload -->
< div ng-show = "state.BuildType === 'upload'" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Upload < / div >
2018-02-28 06:19:06 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2020-05-04 07:54:09 +00:00
You can upload a Dockerfile or a tar archive containing a Dockerfile from your computer. When using a tarball, the root folder will be used as the build
2020-04-10 21:54:53 +00:00
context.
2018-02-28 06:19:06 +00:00
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
2018-07-26 13:09:48 +00:00
< button class = "btn btn-sm btn-primary" ngf-select ngf-min-size = "10" ng-model = "formValues.UploadFile" > Select file< / button >
2022-01-17 05:53:32 +00:00
< span style = "margin-left: 5px" >
2018-02-28 06:19:06 +00:00
{{ formValues.UploadFile.name }}
< i class = "fa fa-times red-icon" ng-if = "!formValues.UploadFile" aria-hidden = "true" > < / i >
< / span >
< / div >
< / div >
< div ng-if = "formValues.UploadFile.type === 'application/gzip' || formValues.UploadFile.type === 'application/x-tar'" >
< div class = "form-group" >
2022-01-17 05:53:32 +00:00
< span class = "col-sm-12 text-muted small" > Indicate the path to the Dockerfile within the tarball. < / span >
2018-02-28 06:19:06 +00:00
< / div >
< div class = "form-group" >
< label for = "image_path" class = "col-sm-2 control-label text-left" > Dockerfile path< / label >
< div class = "col-sm-10" >
2020-04-10 21:54:53 +00:00
< input type = "text" class = "form-control" ng-model = "formValues.Path" id = "image_path" placeholder = "Dockerfile" / >
2018-02-28 06:19:06 +00:00
< / div >
< / div >
< / div >
< / div >
<!-- !upload -->
<!-- url -->
< div ng-show = "state.BuildType === 'url'" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > URL < / div >
2018-02-28 06:19:06 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2020-04-10 21:54:53 +00:00
Specify the URL to a Dockerfile, a tarball or a public Git repository (suffixed by < b > .git< / b > ). When using a tarball or a Git repository URL, the root folder
will be used as the build context.
2018-02-28 06:19:06 +00:00
< / span >
< / div >
< div class = "form-group" >
< label for = "image_url" class = "col-sm-2 control-label text-left" > URL< / label >
< div class = "col-sm-10" >
2022-05-15 21:35:11 +00:00
< input
type="text"
class="form-control"
ng-model="formValues.URL"
id="image_url"
placeholder="https://myhost.mydomain/myimage.tar.gz or https://github.com/myname/myrepo.git#mybranch"
/>
2018-02-28 06:19:06 +00:00
< / div >
< / div >
< div class = "form-group" >
2022-01-17 05:53:32 +00:00
< span class = "col-sm-12 text-muted small" > Indicate the path to the Dockerfile within the tarball/repository (ignored when using a Dockerfile). < / span >
2018-02-28 06:19:06 +00:00
< / div >
< div class = "form-group" >
< label for = "image_path" class = "col-sm-2 control-label text-left" > Dockerfile path< / label >
< div class = "col-sm-10" >
2020-04-10 21:54:53 +00:00
< input type = "text" class = "form-control" ng-model = "formValues.Path" id = "image_path" placeholder = "Dockerfile" / >
2018-02-28 06:19:06 +00:00
< / div >
< / div >
< / div >
<!-- !url -->
2018-07-23 09:31:21 +00:00
< div ng-if = "applicationState.endpoint.mode.agentProxy && applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE'" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Deployment < / div >
2018-05-06 07:15:57 +00:00
<!-- node - selection -->
2020-04-10 21:54:53 +00:00
< node-selector model = "formValues.NodeName" > < / node-selector >
2018-05-06 07:15:57 +00:00
<!-- !node - selection -->
< / div >
2018-02-28 06:19:06 +00:00
<!-- actions -->
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Actions < / div >
2018-02-28 06:19:06 +00:00
< div class = "form-group" >
< div class = "col-sm-12" >
2020-04-10 21:54:53 +00:00
< button
type="button"
class="btn btn-primary btn-sm"
2018-02-28 06:19:06 +00:00
ng-disabled="state.actionInProgress
|| (state.BuildType === 'upload' & & (!formValues.UploadFile || !formValues.Path))
|| (state.BuildType === 'url' & & (!formValues.URL || !formValues.Path))
|| (formValues.ImageNames.length === 0 || !validImageNames())"
2020-04-10 21:54:53 +00:00
ng-click="buildImage()"
button-spinner="state.actionInProgress"
>
2018-02-28 06:19:06 +00:00
< span ng-hide = "state.actionInProgress" > Build the image< / span >
< span ng-show = "state.actionInProgress" > Image building in progress...< / span >
< / button >
2022-01-17 05:53:32 +00:00
< span class = "text-danger" ng-if = "state.formValidationError" style = "margin-left: 5px" > {{ state.formValidationError }}< / span >
2018-02-28 06:19:06 +00:00
< / div >
< / div >
<!-- !actions -->
< / form >
< / uib-tab >
< uib-tab index = "1" disable = "!buildLogs" >
2020-04-10 21:54:53 +00:00
< uib-tab-heading > < i class = "fa fa-file-alt space-right" aria-hidden = "true" > < / i > Output < / uib-tab-heading >
2018-02-28 06:19:06 +00:00
< pre class = "log_viewer" >
< div ng-repeat = "line in buildLogs track by $index" class = "line" > < p class = "inner_line" ng-click = "active=!active" ng-class = "{'line_selected': active}" > {{ line }}< / p > < / div >
< div ng-if = "!buildLogs.length" class = "line" > < p class = "inner_line" > No build output available.< / p > < / div >
< / pre >
< / uib-tab >
< / uib-tabset >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >