This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.23.0-bookworm AS build | |
| ARG upx_version=4.2.4 | |
| RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \ | |
| curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \ | |
| cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \ | |
| chmod +x /usr/local/bin/upx && \ | |
| apt-get remove -y xz-utils && \ | |
| rm -rf /var/lib/apt/lists/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| write_files: | |
| - path: /etc/conf.d/nfs | |
| permissions: '0644' | |
| content: | | |
| OPTS_RPC_MOUNTD="" | |
| coreos: | |
| units: | |
| - name: rpc-statd.service | |
| command: start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| write-files: | |
| - path: /etc/conf.d/nfs | |
| permissions: '0644' | |
| content: | | |
| OPTS_RPC_MOUNTD="" | |
| users: | |
| - name: XYZ | |
| groups: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo ECS_CLUSTER=your_ecs_cluser_name > /etc/ecs/ecs.config | |
| INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
| hostname $INSTANCE | |
| sed -i.bak "s/\\(HOSTNAME=\\).*/\\1$INSTANCE/" /etc/sysconfig/network | |
| # https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/ | |
| yum -y install jq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -e | |
| set -o pipefail | |
| # File 1 is the list of our AMIs | |
| # File 2 is the list of AMIs used by our instances | |
| # Column 1 is an image of ours that is not in use | |
| # Column 2 is an AMI that is in use that isn't one of ours | |
| # Column 3 is the list of our AMIs that are in use. | |
| comm -23 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # delete-ami | |
| # | |
| # A script to deregister an Amazon Machine Image (AMI) and | |
| # delete its corresponding root device snapshot. | |
| # | |
| ##### Functions |