|
1 | 1 |
|
2 | | -# Build Requirements on `Azure Linux` |
| 2 | +# Build Requirements for Azure Linux Toolkit |
3 | 3 |
|
4 | | -## Requirements were validated on `Azure Linux` |
| 4 | +This page outlines the requirements for building with the Azure Linux toolkit on different versions of Azure Linux/Mariner. |
5 | 5 |
|
6 | | -This page lists host machine requirements for building with the Azure Linux toolkit. They cover building the toolchain, packages, and images on an Azure Linux host. |
| 6 | +## System-Specific Requirements |
| 7 | + |
| 8 | +### Golang Package Requirements |
| 9 | + |
| 10 | +Different versions of Azure Linux have been validated with the following Golang packages: |
| 11 | + |
| 12 | +- **Azure Linux 2.0 (CBL-Mariner)**: Validated with `msft-golang-1.24.1` |
| 13 | +- **Azure Linux 3.0**: Validated with `golang-1.24.3` |
| 14 | + |
| 15 | +## Installation Methods |
| 16 | + |
| 17 | +### Method 1: Using Make Targets (Recommended) |
| 18 | + |
| 19 | +The make targets automatically detect your OS version and install the appropriate packages: |
7 | 20 |
|
8 | 21 | ```bash |
9 | | -# Install required dependencies. |
10 | | -sudo ./toolkit/docs/building/prerequisites-mariner.sh |
| 22 | +# For interactive development environments (local machines) |
| 23 | +# Installs prerequisites but doesn't modify system configuration |
| 24 | +# Note: On Azure Linux 2.0, this will remove golang if installed in favor of msft-golang due to the golang version requirement |
| 25 | +sudo make -C toolkit install-prereqs |
| 26 | + |
| 27 | +# Manually configure Docker if needed |
| 28 | +sudo systemctl enable --now docker.service |
| 29 | +sudo usermod -aG docker $USER |
| 30 | +# Note: You will need to log out and log back in for user changes to take effect |
| 31 | + |
| 32 | +# the above step can alternatively be done using the following command if preferred: |
| 33 | +# sudo ./toolkit/docs/building/prerequisites-mariner.sh --no-install-prereqs --configure-docker |
| 34 | + |
| 35 | +-------------- |
| 36 | + |
| 37 | +# For automated environments (CI/CD pipelines) or complete setup |
| 38 | +# Installs prerequisites AND configures Docker and user settings |
| 39 | +sudo make -C toolkit install-prereqs-and-configure |
| 40 | +``` |
| 41 | + |
| 42 | +**Recommendation**: |
| 43 | +- Use `install-prereqs` on your local development machine |
| 44 | +- Use `install-prereqs-and-configure` in CI/CD pipelines or when you need a complete environment setup |
11 | 45 |
|
12 | | -# Also supported is: |
13 | | -# make -C toolkit install-prereqs |
| 46 | +### Method 2: Direct Script Execution |
14 | 47 |
|
15 | | -# Enable Docker daemon at boot |
| 48 | +If you prefer running the script directly, use the appropriate options for your OS version: |
| 49 | + |
| 50 | +#### For Azure Linux 2.0 (CBL-Mariner): |
| 51 | +```bash |
| 52 | +# Install prerequisites with msft-golang |
| 53 | +# Note: This will remove golang if installed in favor of msft-golang due to the golang version requirement |
| 54 | +sudo ./toolkit/docs/building/prerequisites-mariner.sh --use-msft-golang |
| 55 | + |
| 56 | +# Manually configure Docker if needed |
16 | 57 | sudo systemctl enable --now docker.service |
| 58 | +sudo usermod -aG docker $USER |
| 59 | +# Note: You will need to log out and log back in for user changes to take effect |
17 | 60 |
|
18 | | -# Add current user to docker group |
| 61 | +# the above step can alternatively be done using the following command if preferred: |
| 62 | +# sudo ./toolkit/docs/building/prerequisites-mariner.sh --no-install-prereqs --configure-docker |
| 63 | +``` |
| 64 | + |
| 65 | +#### For Azure Linux 3.0: |
| 66 | +```bash |
| 67 | +# Install prerequisites with standard golang |
| 68 | +sudo ./toolkit/docs/building/prerequisites-mariner.sh |
| 69 | + |
| 70 | +# Manually configure Docker if needed |
| 71 | +sudo systemctl enable --now docker.service |
19 | 72 | sudo usermod -aG docker $USER |
| 73 | +# Note: You will need to log out and log back in for user changes to take effect |
| 74 | + |
| 75 | +# the above step can alternatively be done using the following command if preferred: |
| 76 | +# sudo ./toolkit/docs/building/prerequisites-mariner.sh --no-install-prereqs --configure-docker |
20 | 77 | ``` |
| 78 | + |
| 79 | +## Script Options |
| 80 | + |
| 81 | +The `prerequisites-mariner.sh` script supports the following options: |
| 82 | + |
| 83 | +- `--configure-docker`: Enables Docker service at boot and adds your user to the docker group |
| 84 | +- `--no-install-prereqs`: Skips installation of prerequisite packages |
| 85 | +- `--use-msft-golang`: Uses `msft-golang-1.24.1` instead of `golang-1.24.3` (required for Azure Linux 2.0) |
| 86 | +- `--help`: Displays usage information |
| 87 | + |
| 88 | +> **Note**: If you use `--configure-docker`, you will need to log out and log back in for the user changes to take effect. |
0 commit comments