You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are on a Mac with M1 chip, don't forget to export some docker variable to be able to build for AMD
49
-
```
50
-
export DOCKER_BUILDKIT=0
51
-
export COMPOSE_DOCKER_CLI_BUILD=0
52
-
export DOCKER_DEFAULT_PLATFORM=linux/amd64
53
-
```
54
+
The resulting package will be produced in the build/distributions directory. The version is controlled by the value in [version.go](version/version.go).
55
+
To install the agent extract the package and run the install command:
54
56
55
-
If you are on a Mac with M1 chip, don't forget to export some docker variable to be able to build for AMD
56
-
```
57
-
export DOCKER_BUILDKIT=0
58
-
export COMPOSE_DOCKER_CLI_BUILD=0
59
-
export DOCKER_DEFAULT_PLATFORM=linux/amd64
57
+
```sh
58
+
cd build/distributions
59
+
tar xvfz build/distributions/elastic-agent-8.8.0-SNAPSHOT-darwin-aarch64.tar.gz
60
+
cd build/distributions/elastic-agent-8.8.0-SNAPSHOT-darwin-aarch64
61
+
sudo elastic-agent install
60
62
```
61
63
62
-
In Linux operating systems that you can not run docker as a root user you need to follow [linux-postinstall steps](https://docs.docker.com/engine/install/linux-postinstall/)
64
+
For basic use the agent binary can be run directly, with the `sudo elastic-agent run` command.
63
65
64
-
### Testing docker container
66
+
### Docker
65
67
66
68
Running Elastic Agent in a docker container is a common use case. To build the Elastic Agent and create a docker image run the following command:
67
69
68
70
```
71
+
# Use PLATFORMS=linux/arm64 if you are using an ARM based Mac.
Elastic employees can create an Elastic Cloud deployment with a locally
150
-
built Elastic Agent, by pushing images to an internal Docker repository. The images will be
153
+
built Elastic Agent, by pushing images to an internal Docker repository. The images will be
151
154
based on the SNAPSHOT images with the version defined in `version/version.go`.
152
155
153
156
Prerequisite to running following commands is having `terraform` installed and running `terraform init` from within `testing/environments/cloud`.
154
157
155
158
Running a shorthand `make deploy_local` in `testing/environments/cloud` will build Agent, tag the docker image correctly, push it to the repository and deploy to Elastic Cloud.
156
159
157
160
For more advanced scenarios:
158
-
Running `make build_elastic_agent_docker_image` in `testing/environments/cloud` will build and push the images.
161
+
Running `make build_elastic_agent_docker_image` in `testing/environments/cloud` will build and push the images.
159
162
Running `make push_elastic_agent_docker_image` in `testing/environments/cloud` will publish built docker image to CI docker repository.
160
163
161
-
Once docker images are published you can run `EC_API_KEY=your_api_key make apply` from `testing/environments/cloud` directory to deploy them to Elastic Cloud.
164
+
Once docker images are published you can run `EC_API_KEY=your_api_key make apply` from `testing/environments/cloud` directory to deploy them to Elastic Cloud.
162
165
To get `EC_API_KEY` follow [this guide](https://www.elastic.co/guide/en/cloud/current/ec-api-authentication.html)
163
166
164
167
The custom images are tagged with the current version, commit and timestamp. The
165
168
timestamp is included to force a new Docker image to be used, which enables pushing new
166
169
binaries without recreating the deployment.
167
170
168
-
To specify custom images create your `docker_image.auto.tfvars` file similar to `docker_image.auto.tfvars.sample`.
171
+
To specify custom images create your `docker_image.auto.tfvars` file similar to `docker_image.auto.tfvars.sample`.
169
172
170
-
You can also use `mage cloud:image` and `mage cloud:push` respectively from repo root directory.
173
+
You can also use `mage cloud:image` and `mage cloud:push` respectively from repo root directory.
171
174
To deploy your changes use `make apply` (from `testing/environments/cloud`) with `EC_API_KEY` instead of `make deploy_local` described above.
172
175
173
176
SNAPSHOT images are used by default. To use non-snapshot image specify `SNAPSHOT=false` explicitly.
0 commit comments