-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from newrelic/ruby_init_container
Add Ruby agent Dockerfile
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# To build one auto-instrumentation image for Ruby, please: | ||
# - Ensure the packages are installed in the `/instrumentation` directory. This is required as when instrumenting the pod, | ||
# one init container will be created to copy all the content in `/instrumentation` directory to your app's container. | ||
# - Grant the necessary access to `/instrumentation` directory. `chmod -R go+r /instrumentation` | ||
|
||
FROM ruby:latest AS build | ||
WORKDIR /operator-build | ||
ADD Gemfile . | ||
RUN BUNDLE_PATH=workspace bundle install | ||
|
||
FROM busybox | ||
COPY --from=build /operator-build /operator-build | ||
WORKDIR /operator-build | ||
# Shell command to search inside the `workspace/ruby` directory for a directory that starts with `newrelic_rpm`. | ||
# Example of a found result: workspace/ruby/3.2.0/gems/newrelic_rpm-9.9.0 | ||
# Copy the result into a new directory called `/instrumentation`. | ||
RUN sh -c "find 'workspace/ruby/' -type d -name newrelic_rpm\\* -exec cp -r '{}' /instrumentation \\;" | ||
RUN chmod -R go+r /instrumentation | ||
RUN rm -rf /operator-build |
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,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'newrelic_rpm' |