Terraform: Import AWS resources

Problem: Resource already exists If there are some AWS resources that are not exist in terraform scripts and you run terraform apply, you might get “XXXX already exists” errors. I listed some of them: BucketAlreadyExists: The requested bucket name is not available EntityAlreadyExists: A policy called dummy-policy-name already exists. Duplicate names are not allowed ResourceInUseException: Table already exists: dummy-table-name […]

Terraform: Create S3 bucket and DynamoDB table

Let’s say you have a Template file (.yaml) that provisions resources to support Terraform Remote state backed by S3 and DynamoDB for consistency locking as below You can create AWS S3 bucket and DynamoDB table using Designer Template in AWS CloudFormation. Go to AWS Cloud Formation page and click Design template. Copy and paste the […]

Docker: Recovering from deleting /var/lib/docker

I deleted “/var/lib/docker/” when I was dealing with Docker Thin Pool error below. devmapper: Thin Pool has 114247 free data blocks which is less than minimum required 116729 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior However, I couldn’t restart docker and got ea new error: […]

Jenkinsfile: AWS Lambda deployment from S3 bucket

AWS Lambda limits the amount of compute and storage resources that you can use to run and store functions. The deployment package size is 50 MB (zipped). Here is the solution how to beat it. Take a look at this blog for S3 solution as well.   Problem Assuming that you created a zip file called […]

Jenkinsfile: Publish Docker Image to Amazon ECR

Problem You pushed a docker image to AWS ECR and get denied: requested access to the resource is denied error. stage(‘Publish Docker Image to AWS’){ steps { script { //build image commit_id = readFile(‘commit_id’).trim() def image = docker.build(“$ECR_REPO_NAME:$commit_id”) //push image docker.withRegistry( “https://$ECR_REGISTRY”, ECR_CRED) { echo ‘ Pushing Latest docker image’ image.push() } } } } […]

Dockerizing Spring Boot Application (Part 2)

Reducing Docker Image Size My colleagues’ feedback about my previous post helped me investigate more efficient ways of writing Dockerfile. The first thing that I realized was choosing the right image base. Alpine based images are recommended for slimmer images and is much smaller than other base images in general. —Dockerfile 1— FROM java:8 VOLUME /tmp ADD target/demo-0.0.1-SNAPSHOT.jar […]

Dockerizing Spring Boot Application

In my previous post, I mentioned about How to run docker container on your local machine. This post is about the dockerizing backend part of the Nutrition Tracking Application. We will follow these steps: Building Spring Boot project Writing a Dockerfile Building and running docker image Step 1: Building Spring Boot project mvn clean packagewill produce a […]

How to run docker container on your local machine

Introduction I have been working on a hobby project, Nutrition Tracking App, to practice the latest Continuous Integration tools. This post is about dockerizing an Angular2 app and using in your local machine. I skipped the basic definitions about Docker, Containers and CI for the sake of simplicity. Docker Commands Frequently used docker commands. Build […]

Docker Overview

What is Docker? Docker is an open platform for developing, shipping, and running applications. It is one of the popular tools to build Continuous Integration and Delivery pipelines. Each organization has its own way of building DevOps solution depending on their needs. 21 DevOps and Docker Reference Architectures pulled together the design decisions of some organizations. […]