Minimal Infrastructure Template
Introduction¶
This guide walks you through creating a minimal infrastructure environment using containers. We use Docker Compose to orchestrate the following services:
- Nginx (Reverse Proxy)
- Nexus 3 (Artifact Repository)
- GitLab CE (Source Control)
- GitLab Runner (CI/CD Execution)
Using these applications, the infrastructure will support source control, running build pipelines, and hosting/serving artifact packages. These are the minimal requirements to run a Build Tools for VMware Aria project.
This guide also covers configuring the applications, setting up a new project, and building it end-to-end.
Contributions Welcome
Please contribute back to this document if you find out-of-date contents or have ways to improve it.
Prerequisites¶
Installation¶
Before proceeding, ensure you have the following installed on your system:
- Docker Engine
Ensure the Docker host is configured to automatically start after a reboot and add Docker to your PATH.
sudo systemctl start docker sudo systemctl enable docker export PATH=$PATH:~/.docker/bin - Docker Compose
- OpenJDK 17
- Maven 3.9+
- Node.js 22.x (Using fnm to manage Node versions is recommended).
Linux Environments
For Linux, besides Docker, you can use the GitLab Runner's Dockerfile RUN commands to set up your environment automatically.
Validation¶
Validate that all prerequisites are available in your terminal:
docker -v
node -v
mvn -v
java --version
Running the Infrastructure¶
Simple Automated Setup¶
This is a fully automated script to bring the infrastructure up. It will not edit your host files, but you can use the machine's IP.
curl -o- https://raw.githubusercontent.com/vmware/build-tools-for-vmware-aria/refs/heads/main/infrastructure/install.sh | bash
To avoid rate limits, you can optionally perform a Docker login by passing your credentials:
curl -o- https://raw.githubusercontent.com/vmware/build-tools-for-vmware-aria/refs/heads/main/infrastructure/install.sh | bash -s -- <dockerUsername> <dockerPAT>
If you do not edit your host files, adjust the external URL in the docker-compose.yml to use localhost (or your machine's IP) and run the compose file:
sed -i "s|external_url 'http://infra.corp.local/gitlab'|external_url 'http://localhost:8082/gitlab'|" /opt/build-tools-for-vmware-aria/infrastructure/docker-compose.yml
docker compose -f /opt/build-tools-for-vmware-aria/infrastructure/docker-compose.yml up -d --wait
Advanced Manual Setup¶
For a manual installation, follow the steps below:
-
Clone the repository:
git clone https://github.com/vmware/build-tools-for-vmware-aria.git cd build-tools-for-vmware-aria/infrastructure -
Configure Docker Compose: Open the docker-compose.yml file. Check the IPs and port forwarding options for each container. The defaults should work unless you have port collisions. If you change ports, update the Nginx configuration file (nginx/conf.d/main.conf) accordingly.
-
Update your hosts file: Docker provides an internal DNS server in user-defined networks (
infranet). To access the containers via the Nginx reverse proxy from your host machine, map the local IP to the infrastructure domain. Add the following record to your/etc/hosts(Linux/Mac) orC:\Windows\System32\drivers\etc\hosts(Windows) file:127.0.0.1 infra.corp.local -
Start the containers:
docker compose up -d -
Verify the containers are running:
You should seedocker psnginx,nexus,gitlab-ce, andgitlab-runnerlisted as Up. -
Wait for initialization: It may take a few minutes for all services to become fully available at:
- Nginx: http://infra.corp.local
- Nexus: http://infra.corp.local/nexus
- GitLab: http://infra.corp.local/gitlab
Application Setup¶
GitLab¶
-
Retrieve the initial root password:
(Note: This file is automatically deleted 24 hours after the container starts).sudo docker exec -it gitlab-ce grep 'Password:' /etc/gitlab/initial_root_password -
Log in: Navigate to http://infra.corp.local/gitlab/users/sign_in and log in with the username
rootand the password retrieved above. - Change the password: Go to http://infra.corp.local/gitlab/admin/users/root/edit and update the root password.
GitLab Runner¶
- Navigate to the Runners page: http://infra.corp.local/gitlab/admin/runners
- Create a new runner: Click New instance runner. Add a tag (e.g.,
maven), check the Run untagged jobs box, and click Create runner. - Register the runner: Copy the registration command snippet (it contains your
<AUTH_TOKEN>). Execute it inside the runner container:docker exec -it gitlab-runner gitlab-runner register --url http://infra.corp.local/gitlab --token <AUTH_TOKEN> - Follow the setup prompts:
- GitLab instance URL: Leave default and press Enter.
- Runner name: Enter
Mavenor leave default. - Executor: Type
shelland press Enter. - Verify: Go back to the GitLab admin runners page and ensure the new runner is marked as Online.
Nexus¶
- Retrieve the initial admin password:
docker exec nexus sh -c 'cat /nexus-data/admin.password && echo' - Log in: Navigate to http://infra.corp.local/nexus/ and log in with the username
adminand the password retrieved above. - Complete the setup wizard: Follow the prompts to set a new admin password and disable anonymous access.
Environment Setup¶
- Configure Maven: Follow the Getting Started guide to set up your local environment.
- Update
settings.xml: Replace your local~/.m2/settings.xmlwith the provided infrastructure settings.xml. This file configures: - Nexus server authentication.
- A Maven Central mirror routing through Nexus.
- A
nexusprofile defining thereleasesandsnapshotsrepositories.
To quickly copy the file:
mkdir -p ~/.m2
cp .m2/settings.xml ~/.m2/settings.xml
Project Setup¶
- Create a GitLab Repository: Create a new blank project called
demoat http://infra.corp.local/gitlab/projects/new#blank_project. - Clone the repository: Follow the command-line instructions provided by GitLab to clone it locally, and navigate into the directory.
- Generate a project: Run the following Maven Archetype command (replace
<VERSION>with the latest release, e.g.,2.42.0):mvn archetype:generate \ -DinteractiveMode=false \ -DarchetypeGroupId=com.vmware.pscoe.o11n.archetypes \ -DarchetypeArtifactId=package-ts-vra-ng-archetype \ -DarchetypeVersion=<VERSION> \ -DgroupId=local.corp \ -DartifactId=demo \ -DlicenseTechnicalPreview=false \ -DoutputDirectory=../ -
Test locally: Validate the generated project files and test the build:
mvn clean package mvn testNote
You may need to comment out the
vropackage dependency in thevramodule'spom.xmlto successfully build without a live server connection. -
Configure the CI/CD Pipeline: Create a
.gitlab-ci.ymlfile in the repository root:stages: - setup - build - test - install variables: LOCAL_REPO: >- -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository BUILD_OPTS: >- -Dhttps.protocols=TLSv1.2 $LOCAL_REPO -DskipTests=true DEPLOY_OPTS: >- -Dhttps.protocols=TLSv1.2 $LOCAL_REPO -DskipTests=true -Dbuild.number=$CI_PIPELINE_IID -Dsurefire.useSystemClassLoader=false -Pbundle-with-installer -DoutputDirectory=target -DartifactName=artifact.zip -U --batch-mode dynamic_variables: stage: setup script: - echo "GROUP_ID=$(mvn help:evaluate $LOCAL_REPO -Dexpression=project.groupId -q -DforceStdout)" >> build.env - echo "ARTIFACT_ID=$(mvn help:evaluate $LOCAL_REPO -Dexpression=project.artifactId -q -DforceStdout)" >> build.env - echo "PROJECT_VERSION=$(mvn help:evaluate $LOCAL_REPO -Dexpression=project.version -q -DforceStdout)" >> build.env artifacts: expire_in: 3 hours reports: dotenv: build.env build: stage: build script: - mvn $BUILD_OPTS clean package test: stage: test script: - mvn $LOCAL_REPO test install: stage: install needs: ["dynamic_variables"] script: - mvn $DEPLOY_OPTS clean package deploy artifacts: paths: - vra/target/*.zip - vro/target/*.zip name: "$GROUP_ID.$ARTIFACT_ID-$PROJECT_VERSION-$CI_PIPELINE_IID" expire_in: 1 month - Trigger the pipeline: Commit and push your changes to GitLab.
- Validate the pipeline: Navigate to CI/CD > Pipelines in GitLab. Wait for the
setup,build,test, andinstalljobs to succeed. - Download the artifact: Once completed, download the
install:archiveartifact. It will contain thelocal.corp.demo-1.0.0-SNAPSHOT-1.zipinstallation bundle. - Deploy: You can now deploy this bundle using the Bundle Installer Guide or by adding an Aria profile to your
settings.xmland runningmvn package vrealize:push -P<PROFILE_NAME>.
Conclusion¶
This concludes the infrastructure setup. You now have a fully operational, end-to-end architecture to support Build Tools for VMware Aria. You can create, build, test, and push projects through automated pipelines that produce robust installation bundles.
Note
This template is intended as an educational sandbox. You should set up your persistent development and production environments following similar principles with proper security and high-availability configurations.