Teknika
Vol. 14 No. 1 (2025): March 2025

Implementation and Analysis of Container Image Optimization Using Alpine Linux and Multi-Stage Builds

Fachrudin, Mochamad Rizal (Unknown)
Affandi, Arif Saivul (Unknown)



Article Info

Publish Date
03 Mar 2025

Abstract

Containerization enables isolation within a host, with Docker being a popular tool for packaging applications and their dependencies in container images. However, challenges like slow build processes and bloated image sizes can consume resources, slow down builds, and pose security risks. This study optimizes Docker images by combining the Alpine base image with multi-stage builds, analyzing size, build speed, and security across different combinations and environments to identify and propose the most efficient combination solution. The approach used is a quantitative quasi-experiment with a within-subject design. The sample used was a JavaScript framework, with the main experimental group being the combination of Alpine and multi-stage builds, while the comparison group included combinations of Node and Node-Alpine, both in single-stage and multi-stage configurations, as well as single-stage Alpine. Data was obtained from CI/CD, container registry, and Trivy reports. Analyzed by descriptive analysis, One-Way ANOVA or Kruskal Wallis test, and post-hoc test. The results show that combining multi-stage builds with Alpine is considered best practice because it produces the smallest image size, reducing it by up to 94% compared to single-stage Node. It also achieves the shortest build times across all environments and presents low vulnerability issues. However, it is important to note that while the Alpine multi-stage combination offers the most efficient build times, it experiences a 1.3x increase in duration in low-spec environments.

Copyrights © 2025






Journal Info

Abbrev

teknika

Publisher

Subject

Computer Science & IT Electrical & Electronics Engineering Engineering

Description

Teknika is a peer-reviewed journal dedicated to disseminate research articles in Information and Communication Technology (ICT) area. Researchers, lecturers, students, or practitioners are welcomed to submit paper which has topic below: Computer Networks Computer Security Artificial Intelligence ...