AWS: Cross region ECS docker registry support

Let’s say you have a docker registry in US-east-1 and you want to pull the registry in eu-central-1.

1. Add this in the IAM role of the EC2 machine

  "Effect": "Allow", 
  "Action": [ 
    "ecr:PutImage" ], 
  "Resource": "*" 

2. Set the mtu value

sudo ifconfig eth0 mtu 1500

3. Login

$(aws ecr get-login --region us-east-1)

4. Pull the docker image:

docker pull

Any questions? Please comment.

Golang: Get EC2 AWS instance region

Following is the golang code to get the region of an EC2 machine in AWS.

package main

import (

func getRegion() string{
    link := ""
    response, err := http.Get(link)
    if err != nil {
    defer response.Body.Close()

    //block forever at the next line
    content, _ := ioutil.ReadAll(response.Body)

    return string(content)

func main() {
    aws_region := getRegion()


GOLANG: Installation and hello world (Ubuntu)

1. Install latest go

$ sudo apt-add-repository ppa:ubuntu-lxc/lxd-stable
$ sudo apt-get update
$ sudo apt-get install golang

2. Create a Simple first.go file, with following

package main 
import "fmt" 
func main()  { 
    fmt.Printf("hello, world\n") 

3. Run

go run first.go

That’s all.

Any questions?
Please ask in comments