1.3 C
New York
Tuesday, January 9, 2024

Three Amazon Linux 2 Containers for Testing


I often have to check code on Amazon Linux 2 – each for work and for the PowerShell Core common set up script install-powershell.sh that I assist keep on the PowerShell Open Supply challenge.

Spinning up an occasion on Amazon just isn’t a trouble, until in fact, you evaluate it to spinning up a container. Amazon Linux 2 container pictures are essentially super-optimized to run as a container host for functions – so that they have many packages eliminated in comparison with an Amazon Linux 2 EC2 AMI construct.

However when I’m testing one thing that may run on the total EC2 construct, I’d nonetheless like to make use of a container.

Full EC2 Construct in a Container For Testing (Builds Month-to-month)

To fulfill this requirement I’ve created a full ec2 construct container that has all the identical packages. It may be pulled with this command:

docker pull darwinjs/amazonlinux2ec2build

To be fairly clear, I might by no means use this container as a basis for constructing a containerized utility utilizing Amazon Linux 2 containers. Following customary container engineering practices, the bottom amazon container needs to be leveled up with the minimal doable packages to get it prepared for an given microservice.

This method is strictly for fast and soiled testing – normally of shell scripts that don’t have dependencies on an full amazon setting being out there.

Minimal EC2 Container Construct with PowerShell (Builds Month-to-month)

Below the identical method – testing solely – I’ve additionally put collectively an Amazon Linux 2 PowerShell Core container that layers on the naked minimal to get PowerShell Core operational. It may be accessed as such:

docker pull darwinjs/amazonlinux2powershell

Full EC2 Construct with PowerShell (Builds Month-to-month)

I’ve to create PowerShell Core scripts that may run on my crew mates Macs. For this state of affairs a full Ec2 Construct Container together with PowerShell suites the aim nicely:

docker pull darwinjs/amazonlinux2powershell

An alternative choice to this ready container is to run the next one command on the total Amazon Linux 2 EC2 Construct Container to make sure you are getting the very newest model of PowerShell core:

curl -s https://uncooked.githubusercontent.com/PowerShell/PowerShell/grasp/instruments/installpsh-amazonlinux.sh | bash

Gitlab CI is scheduled to construct these pictures on the third day of the month.

Should you discover any of the photographs helpful, please let me know by including a star to it within the docker repository so I do know to maintain investing in it 🙂

The beneath repositories comprise the photographs and the supply information for constructing them utilizing Gitlab CI.

Docker Picture Repos

https://hub.docker.com/r/darwinjs/amazonlinux2ec2build https://hub.docker.com/r/darwinjs/amazonlinux2powershell https://hub.docker.com/r/darwinjs/amazonlinux2ec2buildpowershell

Supply Repos:

https://gitlab.com/DarwinJS/amazon-linux-2-ec2-build https://gitlab.com/DarwinJS/amazon-linux-2-container-with-powershell https://gitlab.com/DarwinJS/amazon-linux-2-ec2-build-container-with-powershell



Supply hyperlink

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles