|
| 1 | +## Steps to build and install Amazon Linux ECS Init RPM: |
| 2 | + |
| 3 | +### Prerequisites |
| 4 | + |
| 5 | +* An **Amazon Linux instance** - This package is specifically designed for Amazon Linux distributions. |
| 6 | +* **Docker** - Docker must be installed and running. You can skip this step if you're using [ECS Optimized AMIs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html), since they come with Docker pre-installed and running at startup. |
| 7 | + ```bash |
| 8 | + # Query the available versions using "yum info docker", and install the latest available version. |
| 9 | + # Example: |
| 10 | + sudo yum install -y docker-25.0.8 |
| 11 | + ``` |
| 12 | + |
| 13 | +* Install required build tools and dependencies: |
| 14 | + ```bash |
| 15 | + sudo yum install -y rpm-build make gcc git wget rpmdevtools |
| 16 | + ``` |
| 17 | + |
| 18 | +* Check out this amazon-ecs-agent package locally on your Amazon Linux instance. |
| 19 | + |
| 20 | +* **Go Language** - The build process requires Go: |
| 21 | + ```bash |
| 22 | + # Query the available versions using "yum info golang", and install the latest available version. |
| 23 | + # Example: |
| 24 | + sudo yum install -y golang-1.24.5 |
| 25 | + ``` |
| 26 | + |
| 27 | +### Build |
| 28 | + |
| 29 | +1. **Build the Amazon Linux RPM**: |
| 30 | + ```bash |
| 31 | + make amazon-linux-rpm-codebuild |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Locate the built RPM**: |
| 35 | + The RPM will be created in the current directory with the naming pattern: |
| 36 | + - For x86_64: `ecs-init-{VERSION}-1.{amzn_version}.x86_64.rpm` |
| 37 | + - For aarch64: `ecs-init-{VERSION}-1.{amzn_version}.aarch64.rpm` |
| 38 | + |
| 39 | +### Install |
| 40 | + |
| 41 | +1. **Stop the existing ECS services** (if running): |
| 42 | + ```bash |
| 43 | + sudo systemctl stop ecs |
| 44 | + sudo systemctl stop amazon-ecs-volume-plugin |
| 45 | + ``` |
| 46 | + |
| 47 | +2. **Remove existing ECS Init package** (if installed): |
| 48 | + ```bash |
| 49 | + sudo rpm -e ecs-init |
| 50 | + ``` |
| 51 | + |
| 52 | +3. **Install the ECS Init RPM built above**: |
| 53 | + ```bash |
| 54 | + sudo rpm -ivh ecs-init-{VERSION}-1.{amzn_version}.{architecture}.rpm |
| 55 | + ``` |
| 56 | + |
| 57 | +4. **(Optional) Install EFS Utils** if EFS support is needed: |
| 58 | + |
| 59 | + ECS AMIs come with EFS utils installed, so you can skip this step if you're using an ECS AMI. |
| 60 | + |
| 61 | + Otherwise, Follow instructions at: https://docs.aws.amazon.com/efs/latest/ug/installing-amazon-efs-utils.html#installing-other-distro for installation. |
| 62 | + |
| 63 | +5. **Start and enable ECS services**: |
| 64 | + ```bash |
| 65 | + sudo systemctl enable --now ecs |
| 66 | + sudo systemctl enable --now amazon-ecs-volume-plugin |
| 67 | + ``` |
0 commit comments