Docker on Linux

I’ve been studying Docker on Linux quite a bit at work. I recently got a new job where I am assigned to work on Docker on Linux proof of concept. I have been learning so much that it’s been really fun.

Of course, it’s not just for my own learning. I have been documenting what I have learned to share it with my team. 

The very important thing I have learned is that Docker is not another VM technology. You try to do something like systemctl start whatever within a container, it will not work. You will get an error like the following.

Failed to get D-Bus connection: Operation not permitted

This is because Docker container is not a VM and there is no kernel, so as a result no service management system is present by default.

From what I have learned, a Docker container is like a service itself with an entry point. An entry point is a command that you execute when the container is created and started. So you have to treat Docker containers a little differently from regular full blown virtual machine. A container is an environment that has all the dependencies for you to execute code and it uses the host’s resources such as CPU, Memory and disk spaces directly.

I am going to blog more about what I have learned in the coming days and weeks and maybe months… Docker is very interesting!

Docker

I’ve been working on Docker for about a week now and I am amazed. I need to write about Docker more on my blog for my own notes and to share with the engineers in the world.

This is in Japanese but I need to re-watch it to get the big picture. Docker is really cool!

https://www.youtube.com/watch?v=5d8O7jm7Q5c

My Convenient PowerShell Stuff

I like a few convenient PowerShell functions that I like to keep in my $profile file. I should start to add more as I find more useful functions.

Function Prompt
{
	"$ "
}

Set-Alias -Name ll -Value Get-ChildItem
Import-Module ActiveDirectory
Import-Module Pester

<#
.Synopsis
   Searches files.
.DESCRIPTION
   Finds files that contains search string.
.EXAMPLE
   Find-InFiles -FindInDir "C:\Temp" -SearchString "Test"
#>
Function Check-LockedAccounts
{
	Begin{}
	Process
	{
		Search-ADAccount -LockedOut
	}
	End{}
}

Function Find-InFiles
{
    [CmdletBinding()]
    [OutputType([int])]
    Param
    (
        [Parameter(Mandatory=$false,
                   ValueFromPipelineByPropertyName=$true,
                   Position=0)] 
        [string] $FindInDir,

        [Parameter(Mandatory=$true,
                   Position=1)] 
        [string] $SearchString,

        [Parameter(Mandatory=$false, Position=2)]
        [string] $FileFilter = "*.*"

    )

    Begin
    {
    }
    Process
    {
		Get-ChildItem -File -Filter $FileFilter -Path $FindInDir -Recurse -Force -ErrorAction Ignore | Where-Object { Select-String $SearchString $_ -Quiet }
    }
    End
    {
    }
}

Function Get-SamAccountName
{
	[CmdletBinding()]
    [OutputType([string])]
    Param
    (
        [Parameter(Mandatory=$True, ValueFromPipelineByPropertyName=$true, Position=0)] 
        [string] $FullName
    )

    Begin
    {
    }
    Process
    {
		$user = Get-ADUser -filter {DisplayName -eq $FullName} | Select Name, SamAccountName
		Return $user
    }
    End
    {
    }
}