Hi, I’m lumin, and this blog is my space to share thoughts on technology, programming, and life’s reflections.

Migrating My CLI APP BulkPR to a Github CLI Extension

Recently, I built a CLI tool called BulkPR for my job. It’s a simple app, but it works for what I needed. However, one challenge I faced was distribution. My colleagues use different systems-some on Windows, some on MacOS-and I need a way to ensure the tool worked smoothly across all environments. The Problem: Cross-Platform Distribution with Docker and Go At first, I tried to solve the cross-platform issue by using Go’s built-in GOOS and GOARCH environment variables to build different binaries for each platform....

December 24, 2024

Reduced Next Js Docker Image

Recently, I noticed that the Docker image size for my Next.js project was quite large. So I decided to do some research and found ways to reduce the image size. Baseline Here’s what my initial Dockerfile looked like: FROM node:18 WORKDIR /app COPY . . RUN yarn install RUN yarn build EXPOSE 3000 CMD ["yarn", "start"] It ended up being around 3GB. Step 1: Use a Smaller Base Image Before making any changes, my Docker image was using the standard Node....

September 10, 2024