Skip to content

Commit

Permalink
Ruby container (#10)
Browse files Browse the repository at this point in the history
* Add Ruby folder

* Add Ruby agent Dockerfile
  • Loading branch information
hannahramadan authored May 31, 2024
1 parent f216fb1 commit 23d18bf
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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

# Install gems from Gemfile into the `workspace` directory
ADD Gemfile .
RUN BUNDLE_PATH=workspace bundle install

FROM busybox

# Copy build artifacts from previous
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 \\;"

# Adjust permissions of `instrumentation` director to readable by everyone
RUN chmod -R go+r /instrumentation

# Clean up build artifacts
RUN rm -rf /operator-build
5 changes: 5 additions & 0 deletions src/ruby/Gemfile
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'
16 changes: 16 additions & 0 deletions src/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file only exists to satisfy FOSSA security scan. It is not used.

GEM
remote: https://rubygems.org/
specs:
newrelic_rpm (9.9.0)

PLATFORMS
ruby
x86_64-darwin-23

DEPENDENCIES
newrelic_rpm

BUNDLED WITH
2.5.6

0 comments on commit 23d18bf

Please sign in to comment.