Skip to main content

Posts

Showing posts from July, 2019

Running PowerShell commands in a Dockerfile

As Docker continues to grow we are starting to see the containerization engine more and more on Windows. With the need for containers on Windows, we also need the same automation we get in Linux with Dockerfiles. Today we're going to create a Dockerfile that runs PowerShell cmdlets.
Prerequisites; 1. Docker for Windows
2. A code editor (VSCode preferred)

Let's go ahead and get our Dockerfile set up. Below is the Dockerfile I used for this post.

from mcr.microsoft.com/windows/servercore:1903 MAINTAINER Michael Levan RUN powershell -Command Install-WindowsFeature -Name Web-Server RUN powershell -Command New-Item -Type File -Path C:\ -Name config
As you can see from the above, this is a tiny Dockerfile. What this will do is install the IIS Windows 

Feature and create a new file in C:\ called "config".
You should see something very similar to the below screenshot;

Next let's create a running container out of our image. First we'll need to run docker container ls to

 get o…

Build a Windows Docker Image with Azure DevOps

Building a Docker Image with CI/CD is very useful. The primary use case I like is that I can set up CI for my Dockerfile. That means any time I update my Docker file it will automagically create a new build for me. Let's get started!

Pre-requisites/what you need: 1) An Azure Account 2) An Azure DevOps Account 3) Azure repos or another source control repo
4) ACR (Azure Container Repository) to store out Docker image 5) VSCode
6) A working knowledge on CI/CD in Azure DevOps (how to create builds, queue builds, build releases)
First things first - let's head over to our source control and copy down our repo. First thing I need to run is git clone yourrepo. I'm using Azure Repos but you can use whatever you prefer. You can copy it to wherever you like to work out of. I typically put everything in /users/me/Documents/GITREPOS on Windows or /users/me/home if I'm on Linux.


Now that we have our git repo copied down, let's go ahead and open up the directory in VSCode. Creat…

What does "DevOps" mean to me?

These opinions are simply opinions. I know that everyone has a different idea of what DevOps is. My hope in this blog post is to help educate others and share with the community.

A few months ago I decided to take a week off and rent a beach house with my son for his first long vacation. As I'm sitting here at 6:30AM, breakfast in front of me and waiting for the little guy to wake up. I got to thinking "what does DevOps mean to me".

What is the role? What is the role of DevOps? It's a lot different than other technology-related positions. Backend developers write code for the backend application. Sysadmins manage the systems in the environment. Security admins manage the compliance and in most cases blue team for organization. Of course these positions have MUCH more going on than just a simple one sentence. All three of these jobs are incredibly needed throughout all organizations. My point to bringing them up was DevOps isn't just a role. DevOps is practicing a…

CI/CD with Azure DevOps - Part 1 - Building an artifact

In a wonderful world where deploying an application is incredibly fast and amazing, where do we start? With Azure DevOps of course! In part 1 of CI/CD with Azure DevOps we are going to create a CI build.

Pre-requisites 1. Azure account (https://azure.microsoft.com/en-us/free/) 2. Azure DevOps account (https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops)
3. An Azure DevOps Project Created (https://docs.microsoft.com/en-us/azure/devops/organizations/projects/create-project?view=azure-devops)
First things first - What are building? We're going to build Redis containers. If you don't know what Redis is, it's an open-source application for database cache. It stores in-memory key-value data. Instead of your customer having to constantly make queries to the database, Redis stores values in cache.
The first thing we want to do is ensure we have our Kubernetes manifest with the proper values.
apiVersion: apps/v1
kind: Deployment

Where have I been?

Hey everyone! I wanted to send a quick update as to why I haven't been posting much. I know I typically post more often but there is a reason I haven't... I got a new job! Yay :). The reason why I haven't been posting is because I've been focusing on getting up to speed with my new position, both at home (learning new technologies, practicing, etc.) and at work (learning the technology stack, how the applications work, dependencies, etc.).

So, what am I doing? As most of you know, I was a Cloud Engineer previously. Now I'm a DevOps Engineer. What has changed in my day-to-day?

First thing is CI/CD. I have been working with CI/CD much more in my new role. This has been an amazing experience and I'm glad I was able get up to speed quickly. My stack revolves around Azure DevOps which is pretty solid. You can do anything from spinning up Docker images to infrastructure to deploying your app.

Second thing is being back in Microsoft land. If you've followed me thr…