Skip to content
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

Fix read-only instructions for running Beats on Docker #41120

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

kilfoyle
Copy link
Contributor

@kilfoyle kilfoyle commented Oct 4, 2024

@blakerouse, Bill noticed a couple of issues with the Run (beat) on a read-only file system instructions:


docker run \
  --mount type=source=$(pwd}/data,destination=/usr/share/{beatname_lc}/data
  --read-only
  {dockerimage}

I believe:

  • the $(pwd} should be $(pwd)
  • the type is missing should be something like type=....,source=

This PR fixes up the first issue, but can you please help with the second? I'm not sure what the change should be, if any. I just copied that command from your comment here.

@kilfoyle kilfoyle added docs Team:Docs Label for the Observability docs team backport-8.15 Automated backport to the 8.15 branch with mergify labels Oct 4, 2024
@kilfoyle kilfoyle requested a review from a team as a code owner October 4, 2024 13:05
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 4, 2024
Copy link
Contributor

mergify bot commented Oct 4, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Oct 4, 2024
Comment on lines 152 to 155
docker run \
--mount type=source=$(pwd}/data,destination=/usr/share/{beatname_lc}/data
--mount type=source=$(pwd)/data,destination=/usr/share/{beatname_lc}/data
--read-only
{dockerimage}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to get it working with type=bind, I also noticed that some \ are missing making copy/paste not to work, here is my fixed version:

docker run --rm \
  --mount type=bind,source=$(pwd)/data,destination=/usr/share/filebeat/data \
  --read-only \
  docker.elastic.co/beats/filebeat:8.15.2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thanks @belimawr!

Here's how it looks now (I'm building the docs off of main but once published this would show an 8.15.2 Docker image):

screen

@kilfoyle kilfoyle requested a review from belimawr October 4, 2024 14:17
@pierrehilbert pierrehilbert added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Oct 4, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@kilfoyle kilfoyle merged commit b7d7fec into elastic:main Oct 7, 2024
142 checks passed
mergify bot pushed a commit that referenced this pull request Oct 7, 2024
* Fix read-only instructions for running Beats on Docker

* Fix up command

(cherry picked from commit b7d7fec)
mergify bot pushed a commit that referenced this pull request Oct 7, 2024
* Fix read-only instructions for running Beats on Docker

* Fix up command

(cherry picked from commit b7d7fec)
pierrehilbert pushed a commit that referenced this pull request Oct 7, 2024
* Fix read-only instructions for running Beats on Docker

* Fix up command

(cherry picked from commit b7d7fec)

Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>
pierrehilbert added a commit that referenced this pull request Oct 8, 2024
* Fix read-only instructions for running Beats on Docker

* Fix up command

(cherry picked from commit b7d7fec)

Co-authored-by: David Kilfoyle <41695641+kilfoyle@users.noreply.github.com>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.15 Automated backport to the 8.15 branch with mergify docs Team:Docs Label for the Observability docs team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants