Skip to main content

2 posts tagged with "Docker"

View All Tags

· 15 min read
Agastya Darma Laksana

In today's rapidly evolving software development landscape, the ability to efficiently build and deploy applications across diverse architectures is crucial. This article will explore an advanced yet accessible approach to creating multi-architecture Docker images, specifically for ARM64 and AMD64 platforms, using GitHub Actions. We will dissect a YAML configuration for a GitHub Actions workflow named 'Deploy Production,' illustrating how to automate the building and pushing of Docker images to Docker Hub.

Our focus will be on leveraging the capabilities of GitHub Actions, including setup of QEMU for emulation and Docker Buildx for building images, along with caching strategies and security practices for Docker Hub integration. This guide aims to equip developers with the knowledge and tools needed to streamline their CI/CD pipelines, ensuring seamless deployment across varied computing environments.

name: Deploy Production
runs-on: ubuntu-latest
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v1
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
context: .
file: ./Dockerfile
push: true
tags: agasdrm/blog:latest,agasdrm/blog:${{ github.run_number }}
platforms: linux/amd64,linux/arm64/v8
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

· 5 min read
Agastya Darma Laksana

Welcome to my latest digital escapade – a tale that’s part tech, part humor, and entirely real. I’m here to tell you about how my blog, once a mere visitor in the vast cloud, found its way to the cozy confines of my own home. Yes, you read that right. My blog now lives on a Raspberry Pi 4 server, right here under my roof. Let’s dive into this delightful journey of migration, shall we?

The Origin Story

Every great adventure starts with a vision. Mine was built with Docusaurus – a fantastic platform that makes documentation a breeze but also doubles up as a brilliant blog framework. It’s like having a Swiss Army knife, but for blogging. Neat, right?

Now, I must confess, I’m a bit of a neat freak when it comes to my digital life. So, naturally, my blog was dockerized. Think of it like packing your entire house into a single, magical suitcase – ready to move anywhere, anytime. This nifty trick made the migration process smoother than my morning espresso.

A Raspberry Homecoming

Now, let’s talk about the star of our show – the Raspberry Pi 4. This tiny yet mighty device transformed from a hobbyist's plaything into the powerhouse behind my blog. Hosting a blog on a Raspberry Pi? Sounds crazy, right? But that's exactly what I did. In the quiet corner of my home, this little gadget hums with the life of my blog, proving that you don't need a massive server to make a big impact on the digital stage.