Vagrant with Docker Postgres

I know this is a very simple blog. However, when you are first starting out with some technology, sometimes its good to get something up and running to get a “feel” for how something works…

So, to get a basic Vagrant box up and running with Postgres hosted in a Docker container.

  1. Install Vagrant for your particular operating system
  2. Create a folder/directory, in this case I named my folder “v-docker-postgres” (horrible name?)
  3. Create a file within this folder named: Vagrantfile
  4. Inside the Vagrantfile, save the following content:Vagrant.configure(“2”) do |config|
    config.vm.box = “wesmcclure/ubuntu1404-docker”

    config.vm.define “acm-db” do |db|
    db.vm.provision “shell”, path: “./provision/db-setup.sh”
    db.vm.hostname = “acm-db”
    db.vm.network “private_network”, ip: “10.20.20.41”
    end
    end

  5. This box is provided by Wes, who has an excellent course on Vagrant on Pluralsight. Go check it out.
  6. With the above in place, create folder in “v-docker-postgres” called, “provision”
  7. Create a file within “provision” named “db-setup.sh”. This is the same name we used in the above Vagrantfile
  8. Inside the “db-setup” file save the following content:#!/usr/bin/env bash

    docker run -d \
    –name postgres \
    -p 5432:5432 \
    –restart unless-stopped \
    postgres:9.5.6-alpine

  9. With all of the above in place, you should now be able to fire this up by opening a terminal/command prompt/bash shell inside the “v-docker-postgres” folder/directory and execute the command: “vagrant up”
  10. If everything has gone well, you should now be able to connect to your database on IP: 10.20.20.40 PORT: 5432

Interesting Podcast #1

When I want to understand what a developer or architect or anyone is interested in, one of my first questions is: what podcasts do you listen to?

I listen to a lot of podcasts! Well, let me clarify. It feels like I listen to many podcasts.

There are probably plenty of people out there that listen to more, but I will start posting ones I enjoyed and learnt from.

Starting with:

James Whittaker on Career Strategy

Very interesting listen.

AWS Codedeploy: Errno 104

Issue:

You may receive an error such as:

‘[Errno 104] Connection reset by peer…

In my case this was happening when I was pushing a Codedeploy via circleci.

Solution:

The AWS user attached to my CircleCI had no permission to write to the S3 I was attempting to upload my deployment to.

Once I updated the policy to allow permission to write to the S3 bucket, this error stopped.

Pretty straight forward fix, but it felt like the error was  a little deceiving.