Skip to content

Instantly share code, notes, and snippets.

@casperisfine
Created February 4, 2024 08:55
Show Gist options
  • Save casperisfine/e25bbb91e81f7a94aaca9b3c616968c2 to your computer and use it in GitHub Desktop.
Save casperisfine/e25bbb91e81f7a94aaca9b3c616968c2 to your computer and use it in GitHub Desktop.
# syntax = docker/dockerfile:1
FROM ruby:3.3-slim
RUN apt-get update && apt-get install -y libjemalloc2
RUN echo "#!/bin/sh\nexport LD_PRELOAD=$(echo /usr/lib/*/libjemalloc.so.2)\nexec \"\$@\"" >> /exec \
&& chmod +x /exec
ENTRYPOINT ["/exec"]
CMD ["ruby", "-e", "p ENV['LD_PRELOAD']"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment