- Why Fasting is Good
- It is just too easy to become mediocre
- We already die
- Today is my birthday
- Refactor Code & Cleaning Up Toilet
- Lessons Learned from Midtrans Hackathon 2018
- Code Review: My Own Experience
- Learning Forward and Sustainability
- Software is an Organization
- Explicit is better than implicit
- All posts ...
How to setup automated docker creation in Travis
Feb 6, 2018
In a typical software project nowadays, we are not shipping packaged software by building manually by our self in our machine, but we employ a build machine dedicated to compile or build then package our app in any kind of package whether it is a container or just a simple archive.
In this blog post, I will explain how I typically setup automated docker container packaging my typical open source project with Travis - a free build (or so called Continuous Integration/Continuous Delivery service). This post is part of my effort to document and transfer knowledge for people in Open Learning Exchange (OLE), where I currently contribute voluntary to. ***
Suppose we want to setup automated Docker container image creation for a project which has objective to containerize Moodle, an open source learning management system. We did it actually we package Moodle in Docker container for both x86 architecture and ARM (RaspberryPi) architecture in treehouses/moodole.
The step-by-step I’ll present here, not presented as your guide, but rather a hint for your own project with any kind of CI/CD tool, you can take this as inspiration, but not for strict guideline.
Travis in a glance
In Travis we define the step of build process in a
yml file called
.travis.yml. It is common nowadays to prefix the configuration or declaration file with a
dot. In most basic way, Travis can provide you with a VM and you can do almost anything there, you can decide whether you need
sudo or not, what is linux distro you want to use, what language do you use (runtime), version of runtime engine do you use, package you want to install, notification via webhook, what kind of system service running, then what is your actual build script. Basically, a lot of things you can do there.
The simplest way