Install Optimizely Agent
This topic describes how to install Optimizely Agent on Linux/macOS, Windows, and Docker.
Running Agent from source (Linux/macOS)
To develop and compile Optimizely Agent from source:
- Install Golang version 1.20+ .
- Clone the Optimizely Agent repo.
- From the repo directory, open a terminal and start Optimizely Agent:
make setup
Then
make run
This starts the Optimizely Agent with the default configuration in the foreground.
Running Agent from source (Windows)
You can use a helper script to install prerequisites (Golang, Git) and compile agent in a Windows environment. Take these steps:
- Clone the Optimizely Agent repo.
- From the repo directory, open a Powershell terminal and run:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
.\scripts\build.ps1
.\bin\optimizely.exe
Running Agent via Docker
If you have Docker installed, you can start Optimizely Agent as a container. Take these steps:
- Pull the Docker image:
docker pull optimizely/agent
By default this will pull the "latest" tag. You can also specify a specific version of Agent by providing the version as a tag to the docker command:
docker pull optimizely/agent:X.Y.Z
- Run the docker container with:
docker run -p 8080:8080
--env OPTIMIZELY_LOG_PRETTY=true
--env OPTIMIZELY_SERVER_HOST=0.0.0.0
--env OPTIMIZELY_SERVER_ALLOWEDHOSTS=127.0.0.1 optimizely/agent
This will start Agent in the foreground and expose the container API port 8080 to the host.
- (Optional) You can alter the configuration by passing in environment variables to the preceding command, without having to create a config.yaml file. See configure optimizely agent for more options.
Versioning:
When a new version is released, 2 images are pushed to dockerhub. They are distinguished by their tags:
- :latest (same as :X.Y.Z)
- :alpine (same as :X.Y.Z-alpine)
The difference between latest and alpine is that latest is built FROM scratch
while alpine is FROM alpine
.
Updated over 1 year ago