# Build Image

## 1. Build Image  <a href="#id-8cbf8723-3261-4a6e-951d-3738b3b8fcb1" id="id-8cbf8723-3261-4a6e-951d-3738b3b8fcb1"></a>

### 1-1. Build Image Info

1\) Select the \[Build/Pipeline] - \[Builds] section.

2\) Click on the "+ Create" button in the upper right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FFIwiRNQcNzyjHQPLx8I9%2Fimage.png?alt=media&#x26;token=2ef02aae-d411-4eb5-8d1b-ca860bdce693" alt=""><figcaption><p>[Screen] Initial Image Build Screen</p></figcaption></figure>

3\) Once the build information window is generated, enter the build details as follows.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FwqS0le7LG6WIowU8rG97%2Fimage.png?alt=media&#x26;token=133289c8-62f8-4c5a-903b-1ed414e8c95b" alt=""><figcaption><p>[Screen] Image Build Information</p></figcaption></figure>

<table><thead><tr><th width="198">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Image Name*</td><td>Specify what the image represents in detail (Note: Avoid the use of uppercase)</td></tr><tr><td>Registry*</td><td><p>Select the registry you created</p><p>(If there are multiple registries, choose the applicable registry)</p></td></tr><tr><td>Use Auto Tag (Choose 1)</td><td><p>Indicate whether tags should be automatically set when updating or changing the image</p><p>(Split into "Use/Do Not Use," and if "Do Not Use" is selected, the tag may be fixed, overwriting the existing image)</p></td></tr><tr><td>Tag*</td><td><p>Provide details for the tag to be attached to the created image</p><p>(If "Do Not Use" is selected for auto-tagging, the tag entered here will be used consistently)</p></td></tr><tr><td>Auto-Increment Type (Choose 1)</td><td>If auto-tagging is set to "Use," it can be specified as "Time/Sequence"</td></tr><tr><td>Build Execution Server (Choose 1)</td><td>Select the server to perform the build</td></tr></tbody></table>

4\) Click the "+ Add a Build operation" button at the bottom to select the necessary items for the build process.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FUBDY1HuAH62PRDHlKG52%2Fimage.png?alt=media&#x26;token=968340fe-2ca4-47b9-9abc-1e2a914504c3" alt=""><figcaption><p>[Screen] List of Build Jobs</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Code Repository Work</td><td>Configure information to fetch source from git or similar sources</td></tr><tr><td>User Work</td><td>Configure information related to the build of the source fetched from git or similar sources</td></tr><tr><td>File (FTP) Work</td><td>Set up tasks to download or upload files or directories between the remote host and the build host where the build tasks are performed</td></tr><tr><td>Calling REST Work</td><td>If integration with external services is required using the REST method, configure REST call tasks</td></tr><tr><td>Script Work</td><td>Configure script information if a specific script is needed</td></tr><tr><td>Build Image Work*</td><td>Write a Dockerfile to apply the built source to a Base image and create a new image</td></tr></tbody></table>

### 1-2. Code Repository Work

1\) Select the \[Code Repository Work] and enter details about the Git or other source from which to load the code, then save.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FwSvx5BWoJUJwrlezbY2t%2Fimage.png?alt=media&#x26;token=05f6081d-da9d-4238-b4af-bc7bea523b2f" alt=""><figcaption><p>[Screen] Code Repository Operations</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>content</th></tr></thead><tbody><tr><td>Work Name*</td><td>Refers to the job stage for the image build, and enters a title for that job</td></tr><tr><td>Repository Address*</td><td>Enter the address for the Git or other source repository from which to import the source code.</td></tr><tr><td>Branch*</td><td>Enter the source branch applied to the repository</td></tr><tr><td>Authentication</td><td>When selecting the combo box for authentication, you must enter the user account and password required to access the git</td></tr><tr><td>Code Storage Path</td><td>Enter the directory to store the source (Automatically create git project name if not created)</td></tr></tbody></table>

### 1-3. User Work

1\) Click the "+Add a Build operation" button to select \[User Work]

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F2iw2pjYBUNM4b7EUC4zE%2Fimage.png?alt=media&#x26;token=5a5a7b1d-4b61-49e2-8735-6f4b03f2fb7d" alt=""><figcaption><p>[Screen] Code Repository Operations After Writing, Click "Add a Build operation" Button</p></figcaption></figure>

2\) In the \[Execution Information] section, enter the necessary commands for source build and apply.

{% hint style="info" %}
\[User Work - Execution Information (Maven)]

1. Work Name: Provide information about the purpose or content of this task.&#x20;
2. Execution Path: Specify the path where the build will be executed in the build container. 1. Enter "/build" as a fixed value when writing.
   {% endhint %}

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fy7oENu5NRj1OxITrNVIZ%2Fimage.png?alt=media&#x26;token=0c080ae9-56ca-40d8-9ccf-29711bf3f049" alt=""><figcaption><p>[Screen] User Task Execution Information for Maven Build</p></figcaption></figure>

{% hint style="info" %}
\[User Work - Execution Information (Ant)]

1. Work Name: Provide information about the purpose or content of this task.&#x20;
2. Execution Path: Specify the path where the build will be executed in the build container. 1. Enter "/build" as a fixed value when writing.
   {% endhint %}

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FoOnwiIk3sQSPINiMfLsM%2Fimage.png?alt=media&#x26;token=36b3262a-cf6e-4c97-9ffb-786fb3bd8379" alt=""><figcaption><p>[Screen] User Task Execution Information during ant Build</p></figcaption></figure>

3\) In the \[Work Volume] section, enter the directory path required for source build and apply

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FDjvFZxK2isPWsKcXgEyu%2Fimage.png?alt=media&#x26;token=80a44ef1-1bef-4743-a149-56dd6af1eccf" alt=""><figcaption><p>[Screen] User Work WORK VOLUME</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Container Path*</td><td>Write the path to the container where the source will be built</td></tr><tr><td>Build Host Path*</td><td>When building the source, a temporary container is created to proceed with the build. This is the path to the temporary container used during the source build</td></tr></tbody></table>

### 1-4. Build Image Task

1\) Click the "+ Add a Build operation" button and select \[Build Image Work].

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F32wFELwPdo9wLUiy86vO%2Fimage.png?alt=media&#x26;token=697d4aad-8d21-4d12-a05f-b86738212a84" alt=""><figcaption><p>[Screen] After writing the user Work, click the "Build image Work" button.</p></figcaption></figure>

2\)  In the \[Build Image Work] section, write the Dockerfile to create a container image after the source build and apply.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fb3glwR2p9Bvm8i4iticD%2Fimage.png?alt=media&#x26;token=e79af493-3972-41cc-a297-0b4db2e8def6" alt=""><figcaption><p>[Screen] Write Dockerfile</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Work name*</td><td>Refers to the job stage for the image build, and enters a title for that job</td></tr><tr><td>enter docker file content*</td><td>Write a Dockerfile to create the actual container image</td></tr></tbody></table>

3\)  After clicking the "Save" button, a popup for \[Build Notes] for the build creation will appear below. Write comments for this build and save.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FYkoQJwN4yo9SN8ZGX7UW%2Fimage.png?alt=media&#x26;token=d620d282-fc34-4297-9843-f4d2e7a2cf12" alt=""><figcaption><p>[Screen] Completion of writing the build image work</p></figcaption></figure>

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FRwZxONEtMYKXDn2991Xg%2Fimage.png?alt=media&#x26;token=892fa19d-c45b-4588-afaa-40a1184822f8" alt="" width="563"><figcaption><p>[Screen] Build Image Creation Popup Window</p></figcaption></figure>

### 1-5. Run Image Build Task

1\)  Once the save is complete, the image build automatically proceeds, and you can review details about the build as shown in the screen below.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FoENCez2enCbbZOhSrtuH%2Fimage.png?alt=media&#x26;token=6238954b-def9-4d12-93d0-1403369356d9" alt=""><figcaption><p>[Screen] Run Build Image </p></figcaption></figure>

2\)  In the \[Build Info], clicking the "View Log" button allows you to check the logs for the image build.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FkZmvSVySlpiwLxFSLr7E%2Fimage.png?alt=media&#x26;token=d0490845-ca3c-49e8-a8fa-f60527ddebd0" alt=""><figcaption><p>[Screen] Build Image Execution Log</p></figcaption></figure>

3\) Upon successful completion of the build, confirm that all progress is marked as "Done" as shown below.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FYB4s1W9U8Cb6E4NO18dA%2Fimage.png?alt=media&#x26;token=1fdf62e4-f7a7-48c6-bcb5-3f6d757fee30" alt=""><figcaption><p>[Screen] build Image complete</p></figcaption></figure>

## 2. Additional Configuration for Image Build

### 2-1. File(FTP) Task

1\) Write files or directories for downloading or uploading between the remote host containing resources related to the build target and the build host where the build task will be performed.

2\) Click the "+ Add a Build operation" button and select \[File (FTP) Work].

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FoCIg2dZsUH9Gjvl9xQYw%2Fimage.png?alt=media&#x26;token=a6db061d-bcc0-4243-b987-bd1974622113" alt=""><figcaption><p>[Screen] File (FTP) Work</p></figcaption></figure>

<table><thead><tr><th width="214">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Work name*</td><td>It refers to the operation stage for the file (FTP), and enter a title for that operation</td></tr><tr><td>Host address*</td><td>Server address with the directory or file that needs to be uploaded</td></tr><tr><td>Certification*</td><td>Need to set up if you have an account and password for the host address</td></tr><tr><td>User/Password*</td><td>Connection account and password for the host address</td></tr><tr><td>Task type (choose one)</td><td>File Download<br>(If you want to include it in the image during image build, select this type)</td></tr><tr><td>Remote Directory/File*</td><td>Absolute path to the file to be uploaded to the image when building the image (Host address must have that file)</td></tr><tr><td>Build Host Directory*</td><td>Directory location to upload <br>(/tmp/ fixed)</td></tr></tbody></table>

### 2-2. Calling REST Work

1\) If integration with an external service is required using the REST method, configure the REST call task.

2\) Click the "+ Add a Build operation" button and select \[Calling REST Work].

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FYCPNt0YGgZAwQR60tfsn%2Fimage.png?alt=media&#x26;token=4ad9647c-0214-472d-83e0-44aca756862f" alt=""><figcaption><p>[Screen] Calling REST Work</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Work name*</td><td>Indicates the operation stage for a REST call, and enters a title for that operation</td></tr><tr><td>REST Method (choose one)</td><td>Choose the API call method</td></tr><tr><td>URL*</td><td>Write the URL for the API call</td></tr><tr><td>Certification</td><td>Configuration required if there is an account and password for the host address</td></tr><tr><td>User/Password</td><td>Username and password for the host address</td></tr><tr><td>Connection Timeout*</td><td>Write the response time for the API call</td></tr><tr><td>Expected response code*</td><td>Write the success code after the API call <br>(ex] 200)</td></tr><tr><td>Expected response content</td><td>Must be left blank</td></tr><tr><td>Save the response to the build host path</td><td>Write the filename if response value storage is required <br>(ex] response.txt)</td></tr></tbody></table>

3\) If headers are required, select "+ Header Add " enter the Header and Value, and click the "Apply" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FTrPaQi0xe53nNVw8jjyU%2Fimage.png?alt=media&#x26;token=840bf928-eee3-48c5-9394-58eea7432284" alt=""><figcaption><p>[Screen] Calling REST Work Screen - HEADER</p></figcaption></figure>

{% hint style="info" %}

* Enter in the format: Header: Authorization, Value: Basic {authentication string}.&#x20;
* The {authentication string} should be a base64-encoded string of the Image Registry's id:password.
  {% endhint %}

### 2-3. Script Work

1\) Define tasks for cases where scripts are needed during image builds.

2\) Click the "+ Add a Build operation" button and select \[Script Work].

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FlU33IF9Iv2qv8gxCxyuo%2Fimage.png?alt=media&#x26;token=3810bb04-1d1c-4105-8d04-15446009fd11" alt=""><figcaption><p>[Screen] Script Work</p></figcaption></figure>

<table><thead><tr><th width="204">Item (* is required)</th><th>Content</th></tr></thead><tbody><tr><td>Work name*</td><td>Define the steps for the image build process along with the corresponding work title.</td></tr><tr><td>Enter the script content*</td><td>Enter the content of the script to be executed.</td></tr></tbody></table>

3\) Complete the script task and click the "Apply" button in the bottom right corner.
