-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for docker images (#418)
- Loading branch information
Showing
12 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
title: "Docker Images" | ||
draft: false | ||
description: "Learn how to build and run NGINX Agent docker images" | ||
weight: 800 | ||
toc: true | ||
tags: [ "docs" ] | ||
categories: ["configuration"] | ||
doctypes: ["task"] | ||
--- | ||
|
||
## Prerequisites | ||
1. Docker must be [installed and running](https://docs.docker.com/engine/install/) | ||
1. (Optional) If you plan to use NGINX Plus, you will need the nginx-repo.crt and nginx-repo.key files. You can download them from [MyF5](https://my.f5.com). | ||
|
||
## Building NGINX Agent image with NGINX Open Source | ||
|
||
To build an image that contains the latest NGINX Agent and the latest mainline version of NGINX run the following command: | ||
|
||
```shell | ||
$ cd scripts/docker/official/nginx-oss-with-nginx-agent/alpine/ | ||
$ docker build -t nginx-agent . --no-cache -f ./Dockerfile.mainline | ||
``` | ||
|
||
To build an image that contains the latest NGINX Agent and the latest stable version of NGINX run the following command: | ||
```shell | ||
$ cd scripts/docker/official/nginx-oss-with-nginx-agent/alpine/ | ||
$ docker build -t nginx-agent . --no-cache -f ./Dockerfile.stable | ||
``` | ||
|
||
## Building NGINX Agent image with NGINX Plus | ||
|
||
1. Log in to [MyF5 Customer Portal](https://account.f5.com/myf5) and download your `nginx-repo.crt` and `nginx-repo.key` files. These files are also provided with the NGINX Plus trial package. | ||
|
||
1. Copy the files to the directory where the Dockerfile is located `scripts/docker/official/nginx-plus-with-nginx-agent/alpine/`. | ||
|
||
1. To build an image that contains the latest NGINX Agent and the latest version of NGINX Plus run the following command: | ||
|
||
```shell | ||
$ cd scripts/docker/official/nginx-plus-with-nginx-agent/alpine/ | ||
$ docker build -t nginx-agent . \ | ||
--no-cache -f ./Dockerfile \ | ||
--secret id=nginx-crt,src=nginx-repo.crt \ | ||
--secret id=nginx-key,src=nginx-repo.key | ||
``` | ||
|
||
## Running NGINX Agent container | ||
|
||
Here is an example of how to run a NGINX Agent container: | ||
|
||
```console | ||
$ docker run --name nginx-agent -d nginx-agent | ||
``` | ||
|
||
By default, the NGINX Agent REST API is not enabled. To enable the API, the NGINX Agent configuration file `nginx-agent.conf` needs to be updated to include the API configuration, for example: | ||
|
||
```yaml | ||
api: | ||
host: 0.0.0.0 | ||
port: 8038 | ||
``` | ||
Once the `nginx-agent.conf` file is updated with the API setting, following the previous example, you can run the container with the updated `nginx-agent.conf` mounted and the port `8038` exposed with the following command: | ||
|
||
```console | ||
$ docker run --name nginx-agent -d \ | ||
--mount type=bind,source="$(pwd)"/nginx-agent.conf,target=/etc/nginx-agent/nginx-agent.conf,readonly \ | ||
-p 127.0.0.1:8038:8038/tcp \ | ||
nginx-agent | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters