I’m trying to build a custom docker image cabable of running the octopus tentacle service and powershell scripts that can use the AWS.Tools powershell modules. Ultimately I want to run this tentacle in ECS.
I’ve tried a few approaches starting from different base images:
FROM mcr.microsoft.com/powershell:7.2-alpine-3.13
as this has powershell already installed and running. I can easily add the AWS.Tools modules. However getting the linux tentacle package installed on to this base is too hard as I need to add too many prereqs (eg bash etc)
FROM amazonlinux:2
. I can install powershell and modules, and it has all the tentacle prereqs. However I don’t know how to have the tentacle installed correctly as the instructions here Linux Tentacle - Octopus Deploy indicate running an interactive configure script and I need to split some installation steps into my Dockerfile vs the initial CMD. I tried to source Dockerfile steps from OctopusTentacle/Dockerfile at main · OctopusDeploy/OctopusTentacle · GitHub but thats not really reusable with the linux installer.
FROM octopusdeploy/tentacle:latest
. With this base, I am able to install powershell using the Debian 11 instructions listed here: Installing PowerShell on Debian Linux - PowerShell | Microsoft Learn. I’m then able to install the AWS.Tools modules that I require.
This last image has the most success as it will run and register with my octo server. However it is over 1Gb in size. I am able to run AWS commands in the script task window, but the output contains garbage escape chars. eg Get-EC2Instance
in a script task window outputs the following:
e[32;1mGroupNames : e[0m{}
October 18th 2022 16:03:45
Info
e[32;1mGroups : e[0m{}
October 18th 2022 16:03:45
Info
e[32;1mInstances : e[0m{DINGSTAG}
October 18th 2022 16:03:45
Info
e[32;1mOwnerId : e[0m9013111111111
October 18th 2022 16:03:45
Info
e[32;1mRequesterId : e[0m
October 18th 2022 16:03:45
Info
e[32;1mReservationId : e[0mr-0e4f0c7acXXXXXXX
October 18th 2022 16:03:45
Info
e[32;1mGroupNames : e[0m{}
October 18th 2022 16:03:45
Info
e[32;1mGroups : e[0m{}
October 18th 2022 16:03:45
Info
e[32;1mInstances : e[0m{DINGSTAG}
October 18th 2022 16:03:45
Info
e[32;1mOwnerId : e[0m90137411111111
October 18th 2022 16:03:45
Info
e[32;1mRequesterId : e[0m
October 18th 2022 16:03:45
Info
e[32;1mReservationId : e[0mr-02a12fceXXXXXXXX
So my questions:
- Is there a better way to build a smaller custom docker linux tentacle, capable of runing powershell scripts?
- If not, is there something I can do to make my current image not mangle all the output?
Sincerely
Pete
Dockerfile (1.6 KB)