-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (40 loc) · 1.76 KB
/
Dockerfile
File metadata and controls
55 lines (40 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM public.ecr.aws/lambda/ruby:3.4 as ruby_dependencies_34
# Install system dependencies for native extensions
RUN dnf update -y && \
dnf install -y gcc gcc-c++ make
# Configure bundler and install gems
RUN echo "source 'https://rubygems.org'; gem 'instana'; gem 'get_process_mem'" > Gemfile && \
bundle config set --local path vendor/bundle && \
bundle install
# Create the layer structure
RUN mkdir -p ruby/gems/3.4.0 && \
cp -r vendor/bundle/ruby/3.4.0*/* ruby/gems/3.4.0/
FROM public.ecr.aws/lambda/ruby:3.3 as ruby_dependencies_33
# Install system dependencies for native extensions
RUN dnf update -y && \
dnf install -y gcc gcc-c++ make
# Configure bundler and install gems
RUN echo "source 'https://rubygems.org'; gem 'instana'; gem 'get_process_mem'" > Gemfile && \
bundle config set --local path vendor/bundle && \
bundle install
# Create the layer structure
RUN mkdir -p ruby/gems/3.3.0 && \
cp -r vendor/bundle/ruby/3.3.0*/* ruby/gems/3.3.0/
FROM public.ecr.aws/lambda/ruby:3.2 as ruby_dependencies_32
# Install system dependencies for native extensions
RUN yum update -y && \
yum install -y gcc gcc-c++ make && \
yum install -y zip
# Configure bundler and install gems
RUN echo "source 'https://rubygems.org'; gem 'instana'; gem 'get_process_mem'" > Gemfile && \
bundle config set --local path vendor/bundle && \
bundle install
# Create the layer structure
RUN mkdir -p ruby/gems/3.2.0 && \
cp -r vendor/bundle/ruby/3.2.0*/* ruby/gems/3.2.0/
FROM public.ecr.aws/docker/library/alpine:3.22 as final
RUN apk add --no-cache zip unzip
COPY --from=ruby_dependencies_34 /var/task/ruby/ ruby/
COPY --from=ruby_dependencies_33 /var/task/ruby/ ruby/
COPY --from=ruby_dependencies_32 /var/task/ruby/ ruby/
RUN zip -r /layer.zip ruby/