Skip to content

Instantly share code, notes, and snippets.

package main
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/bash"
"universe.dagger.io/docker"
)
_workdir: "/usr/app"
run: |
echo "The test took ${{ steps.tstExec.outputs.time }}ms to run"
  echo "The test result was ${{ steps.tstExec.outputs.computedStatus }}"
  echo "View Report - ${{ steps.tstExec.outputs.reportUrl }}"
#!/bin/bash
CLUSTER_NAME=example-eks-fargate-123
AWS_REGION=eu-west-1
#assumes your AWS creds are in ~/.aws/credentials
AWS_ACCESS_KEY_ID=$(awk '-F=' '/aws_access_key_id/ { print $2 }' ~/.aws/credentials)
AWS_SECRET_ACCESS_KEY=$(awk '-F=' '/aws_secret_access_key/ { print $2 }' ~/.aws/credentials)
#check for needed commands
command -v eksctl >/dev/null 2>&1 || { echo >&2 "I require eksctl but it's not installed. Aborting."; exit 1; }
CLUSTER_NAME=<your cluster name>
AWS_REGION=<your region>
#https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html
cat << EOF > ./trust-relationship.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetRole",
"iam:GetInstanceProfile",
{
"family": "petstore",
"networkMode": "awsvpc",
"containerDefinitions": [{
"name": "postgres",
"entryPoint": ["/bin/sh"],
"command": null,
"image": "<YourAccountID>.dkr.ecr.us-west-2.amazonaws.com/petstore_postgres:latest",
"cpu": 512,
"memoryReservation": 1024,
sysctl net.bridge.bridge-nf-call-iptables=1
apt-get update && apt-get upgrade
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 18.03 | head -1 | awk '{print $3}')
* Obtaining IP via DHCP (eth2)...: i40e 0002:01:00.2 eth2: NIC Link is Up, 1000 Mbps Full Duplex, Flow Control: None
udhcpc: started, v1.28.4
udhcpc: sending discover
udhcpc: sending select for 10.0.200.178
udhcpc: lease of 10.0.200.178 obtained, lease time 3600
ok.
cat: can't open '/sys/class/dmi/id/product_uuid': No such file or directory
Connecting to 10.32.172.14 (10.32.172.14:80)
dummy.apkovl.tar.gz 100% |*******************************| 658 0:00:00 ETA
* Loading user settings from /tmp/dummy.apkovl.tar.gz: 0% ok.
https://cloudplatform.googleblog.com/2018/05/Exploring-container-security-Using-Cloud-Security-Comma.html
https://www.itcentralstation.com/product_reviews/dynatrace-review-50093-by-con329e
cat > /etc/apk/repositories <<EOF
http://mirror.csclub.uwaterloo.ca/alpine/v3.8/main
http://mirror.csclub.uwaterloo.ca/alpine/v3.8/community
#http://mirror.csclub.uwaterloo.ca/alpine/v3.8/testing
EOF
apk update
apk upgrade
apk add ruby ruby-dev alpine-sdk
gem install --no-document bundler rake facter fpm