go

Docker, GO and CGO application build

Docker, GO and CGO application build

I’ve been avoiding Docker for a very long time. I started as a sysadmin setting up servers running FreeBSD and early versions of Debian on bare-bone servers. As soon as “cloud” came into the market, I switched to AWS and GCE and have used them since then. EC2 was my always goto choice to deploy something on the internet quickly. But Docker — for some reason, I was avoiding it until this two years ago, when I started using it. Without too much trust.

But today, history is not about my love & hate relationship with Docker, but about deploying the GO application and VIPS library. A couple of problems appeared during the process, and it’s worth mentioning them for future generations because I could find much help around my issues.

Why VIPS and Go it’s not a good match for production environment

Why VIPS and Go it’s not a good match for production environment

using cgo bindings in go is a not an easy way

I built a simple worker to do some magic with images by using Go & VIPS . I chose VIPS because it is blazing fast compared to other Go image processing libraries. So this is the story about what went wrong. Because my DEV setup is Apple MacBook Pro with M1 Apple Silicon, it’s always tricky to compile something to the proper architecture. Installing VIPS on my machine, it’s pretty straightforward:
Automated email parser

Automated email parser

It’s a simple mechanic to decompose emails into valuable parts, like some markup (to push emails directly into internal systems), create file attachments and extract inline images. Flow is pretty simple, but we have a couple of components. We need something to “receive” emails. The easiest way is to use Amazon SES or mailgun or… something else. There are a couple of SASS solutions for that. Next step is to be notified when the email arrives, so we don’t have overhead with checking email every couple of minutes We have to “decompose” – decode email from it’s raw format to text, and attachments.

How to install latest golang on EC2

If you are looking for simple way to upgrade yourt golang installation on EC2, you can experience error like that: Error: Package: golang-bin-1.5.1-0.el6.x86_64 (epel) Requires: go = 1.5.1-0.el6 Installing: golang-1.4.2-3.19.amzn1.x86_64 (amzn-main) Because on amzn-main repo, there is an older version of golang – on epel, there is a newer. Nothing simplier just disable for a momement amzn-main repo, and install golang compeltly from epel. sudo yum --disablerepo=amzn-main --enablerepo=epel install golang-bin
How update Go library

How update Go library

Installation of go library is pretty simple: go get github.com/garyburd/redigo/redis From time to time, you want to get fresh version of it. If you run that command again it will NOT update the library – because it’s already there. To update it you need to use the -u switch: go get -u github.com/garyburd/redigo/redis