Skip to content

Add Dockerfile for agent #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 1, 2023

Conversation

kate-osborn
Copy link
Contributor

@kate-osborn kate-osborn commented Jan 30, 2023

Adds Dockerfile for the agent and Makefile command to build the agent container (#376)

I had to add a couple workarounds in the Dockerfile that are outlined below and in the comments of the file itself:

  1. For now, we install the agent by downloading the .apk file from their github releases. Ideally, we would install the agent via a pre-built and published package. If/when that is supported, we will update our installation process.
  2. We do not add the Linux capability (CAP_NET_BIND_SERVICE) to the nginx and nginx debug binaries. This capability allows nginx to bind to privileged ports. Adding this capability prevents the agent from reading nginx's /proc/<pid>/exe symlink which the agent requires to determine the path to the nginx binary. While we wait for a more permanent fix, we will work around this by having nginx bind to non-privileged ports. See this write-up for more details: https://dxuuu.xyz/filecaps.html

In addition to the Dockerfile, I added a deployment manifest for the agent. This is for testing purposes only, and is not the agent's final manifest.

One final note, CI build/publish steps are out of scope for this PR

@kate-osborn kate-osborn requested a review from a team as a code owner January 30, 2023 20:19
@github-actions github-actions bot added the enhancement New feature or request label Jan 30, 2023
@kate-osborn kate-osborn requested a review from pleshakov January 30, 2023 20:19
@brianehlert
Copy link

Is the intention to then use this container and add a layer with NGINX?
Asking since this appeared to be agent only and not NGINX / NGINX Plus.
And I didn't think we were following a sidecar pattern (nor do I think that in the best interest of the customer).

@kate-osborn
Copy link
Contributor Author

Is the intention to then use this container and add a layer with NGINX? Asking since this appeared to be agent only and not NGINX / NGINX Plus. And I didn't think we were following a sidecar pattern (nor do I think that in the best interest of the customer).

The docker container runs both NGINX OSS and the agent processes. The docker image is based off the nginx image and the entrypoint.sh script kicks off nginx and nginx-agent processes.

@kate-osborn kate-osborn requested a review from pleshakov January 31, 2023 20:45
@kate-osborn kate-osborn merged commit adfaab2 into feature/cp-dp-separation Feb 1, 2023
@kate-osborn kate-osborn deleted the feature/agent-dockerfile branch February 1, 2023 17:33
kate-osborn added a commit that referenced this pull request Feb 6, 2023
kate-osborn added a commit that referenced this pull request Feb 28, 2023
kate-osborn added a commit that referenced this pull request Mar 9, 2023
kate-osborn added a commit that referenced this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants