go

Docker, GO and CGO application build

Docker, GO and CGO application build

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

But today history is not about my love & hate relationship with docker, but about trying to deploy Go application and VIPS library. Couple problems appeared during the process and it’s worth mentioning it for future generations because 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 was building simple worker using Go & VIPS o do some kind of magic with images. I chose VIPS because is blazing fast in comparison with 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 straight forward:
Automated email parser

Automated email parser

It’s a simple mechanic to decompose emails into useful parts, like some markup (to squiz emails directly into internal systems) and create file attachments – and extract inline images. Flow is pretty simple, but we have couple components. We need something to “receive” emails. Easiest way is to use Amazon SES or mailgun or… something else. There is a couple SASS solutions for that Next step is to be notified when email arrive, 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