Skip to content

How to create a custom MinIO image for testing purposes

Cesar Celis Hernandez edited this page Mar 9, 2022 · 6 revisions

Introduction

All started because of this task: https://github.com/miniohq/engineering/issues/441 that I got assigned in order to improve our coverage of this repository. The task is simple if you have KMS enabled in MinIO but that is not the case when I got this task. If you are interested in KMS, I recommend you to read more on the documentation available at: https://docs.min.io/docs/minio-kms-quickstart-guide.html Anyway, the center of this discussion is more on the fact that I wanted to learn how to modify a MinIO Docker Image with the intention of putting KMS on top of it, in this known how document, I will focus in just a simple task, we are going to show how to customize your MinIO image and that will let you go further with any other related task like mine. Ok, without further ado, let's start.

Get MinIO Binary for the architecture you are planning to use

Architecture

There are several ways in which you can get MinIO binary. You can either call make all at minio/minio repo and get the binary compiled with your machine architecture or you can just download directly from: https://min.io/download#/linux For this particular example, and since I have an Apple M1 Chip, I will proceed to download from the webpage. The reason is simple, I want to compile for Ubuntu Virtual Machines on our GitHub actions. If by mistake you provide your compiled binary to a different architecture, you are going to get this message below:

/usr/bin/docker-entrypoint.sh: line 24: /opt/bin/minio: cannot execute binary file: Exec format error
/usr/bin/docker-entrypoint.sh: line 24: /opt/bin/minio: Success

That means that you are trying to execute a binary from another architecture and this is not possible. So be careful and select the architecture that matches your Docker Container.