Skip to content

Commit 0fc3a3e

Browse files
committed
Add Ruby 3.3, 3.4 onboarding containers
1 parent dbb6fea commit 0fc3a3e

File tree

10 files changed

+216
-0
lines changed

10 files changed

+216
-0
lines changed

utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multialpine.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ weblog:
1010
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml
1111
- name: copy-ruby-app
1212
local_path: lib-injection/build/docker/ruby
13+
- name: copy-ruby3_4-app-dockerfile
14+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_4-alpine
15+
- name: copy-ruby3_3-app-dockerfile
16+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_3-alpine
1317
- name: copy-ruby3_2-app-dockerfile
1418
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_2-alpine
1519
- name: copy-ruby3_1-app-dockerfile

utils/build/virtual_machine/weblogs/ruby/provision_test-app-ruby-multicontainer.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ weblog:
1010
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml
1111
- name: copy-ruby-app
1212
local_path: lib-injection/build/docker/ruby
13+
- name: copy-ruby3_4-app-dockerfile
14+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_4
15+
- name: copy-ruby3_3-app-dockerfile
16+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_3
1317
- name: copy-ruby3_2-app-dockerfile
1418
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_2
1519
- name: copy-ruby3_1-app-dockerfile
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM public.ecr.aws/docker/library/ruby:3.3-alpine
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Set timezone to UTC by default
6+
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
7+
8+
# Upgrade RubyGems and Bundler
9+
RUN gem update --system 3.4.22
10+
RUN gem install bundler -v '~> 2.4.22'
11+
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
12+
ENV BUNDLE_SILENCE_ROOT_WARNING 1
13+
14+
# Setup directory
15+
RUN mkdir /app
16+
WORKDIR /app
17+
18+
# Add files
19+
COPY lib_injection_rails_app /app
20+
21+
# Install gems
22+
RUN bundle install
23+
24+
# Set entrypoint
25+
ENTRYPOINT ["/bin/bash", "-c"]
26+
27+
CMD ["bin/rails server -b 0.0.0.0 -p 18080"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM public.ecr.aws/docker/library/ruby:3.4-alpine
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Set timezone to UTC by default
6+
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
7+
8+
# Upgrade RubyGems and Bundler
9+
RUN gem update --system 3.4.22
10+
RUN gem install bundler -v '~> 2.4.22'
11+
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
12+
ENV BUNDLE_SILENCE_ROOT_WARNING 1
13+
14+
# Setup directory
15+
RUN mkdir /app
16+
WORKDIR /app
17+
18+
# Add files
19+
COPY lib_injection_rails_app /app
20+
21+
# Install gems
22+
RUN bundle install
23+
24+
# Set entrypoint
25+
ENTRYPOINT ["/bin/bash", "-c"]
26+
27+
CMD ["bin/rails server -b 0.0.0.0 -p 18080"]

utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ services:
1212
healthcheck:
1313
test: "curl -f http://localhost:8080"
1414

15+
ruby_3_4:
16+
env_file: "scenario_app.env"
17+
image: system-tests/ruby_3_4:latest
18+
restart: always
19+
build:
20+
context: .
21+
dockerfile: Dockerfile.ruby_3_4-alpine
22+
healthcheck:
23+
test: "curl -f http://localhost:18080"
24+
25+
ruby_3_3:
26+
env_file: "scenario_app.env"
27+
image: system-tests/ruby_3_3:latest
28+
restart: always
29+
build:
30+
context: .
31+
dockerfile: Dockerfile.ruby_3_3-alpine
32+
healthcheck:
33+
test: "curl -f http://localhost:18080"
34+
1535
ruby_3_2:
1636
env_file: "scenario_app.env"
1737
image: system-tests/ruby_3_2:latest

utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ http {
99
'"$request" $status $upstream_addr '
1010
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
1111

12+
upstream ruby_3_4_app {
13+
server ruby_3_4:18080;
14+
}
15+
upstream ruby_3_3_app {
16+
server ruby_3_2:18080;
17+
}
1218
upstream ruby_3_2_app {
1319
server ruby_3_2:18080;
1420
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM public.ecr.aws/docker/library/ruby:3.3
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Install prerequisites
6+
RUN set -ex && \
7+
echo "===> Installing dependencies" && \
8+
apt-get -y update && \
9+
apt-get install -y --force-yes --no-install-recommends \
10+
curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \
11+
\
12+
echo "===> Installing database libraries" && \
13+
apt-get install -y --force-yes --no-install-recommends sqlite3 && \
14+
\
15+
echo "===> Installing dev tools" && \
16+
mkdir -p /usr/share/man/man1 && \
17+
apt-get install -y --force-yes --no-install-recommends \
18+
sudo git openssh-client rsync vim \
19+
net-tools netcat-traditional parallel unzip zip bzip2 && \
20+
\
21+
echo "===> Cleaning up" && \
22+
rm -rf /var/lib/apt/lists/*;
23+
24+
# Set timezone to UTC by default
25+
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
26+
27+
# Upgrade RubyGems and Bundler
28+
RUN gem update --system 3.4.22
29+
RUN gem install bundler -v '~> 2.4.22'
30+
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
31+
ENV BUNDLE_SILENCE_ROOT_WARNING 1
32+
33+
# Setup directory
34+
RUN mkdir /app
35+
WORKDIR /app
36+
37+
# Add files
38+
COPY lib_injection_rails_app /app
39+
40+
# Replace the incompatible bigdecimal version constraint
41+
RUN sed -i "s|gem 'bigdecimal', '~> 1.2', '>= 1.2.7'|gem 'bigdecimal', '>= 3.1.0'|" Gemfile
42+
# Add/replace nio4r constraint
43+
RUN grep -q "gem 'nio4r'" Gemfile || echo "gem 'nio4r', '>= 2.5.9'" >> Gemfile
44+
45+
# Install gems
46+
RUN bundle install
47+
48+
# Set entrypoint
49+
ENTRYPOINT ["/bin/bash", "-c"]
50+
51+
CMD ["bin/rails server -b 0.0.0.0 -p 18080"]
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM public.ecr.aws/docker/library/ruby:3.4
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Install prerequisites
6+
RUN set -ex && \
7+
echo "===> Installing dependencies" && \
8+
apt-get -y update && \
9+
apt-get install -y --force-yes --no-install-recommends \
10+
curl wget tar gzip gnupg apt-transport-https ca-certificates tzdata locales && \
11+
\
12+
echo "===> Installing database libraries" && \
13+
apt-get install -y --force-yes --no-install-recommends sqlite3 && \
14+
\
15+
echo "===> Installing dev tools" && \
16+
mkdir -p /usr/share/man/man1 && \
17+
apt-get install -y --force-yes --no-install-recommends \
18+
sudo git openssh-client rsync vim \
19+
net-tools netcat-traditional parallel unzip zip bzip2 && \
20+
\
21+
echo "===> Cleaning up" && \
22+
rm -rf /var/lib/apt/lists/*;
23+
24+
# Set timezone to UTC by default
25+
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
26+
27+
# Upgrade RubyGems and Bundler
28+
RUN gem update --system 3.4.22
29+
RUN gem install bundler -v '~> 2.4.22'
30+
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
31+
ENV BUNDLE_SILENCE_ROOT_WARNING 1
32+
33+
# Setup directory
34+
RUN mkdir /app
35+
WORKDIR /app
36+
37+
# Add files
38+
COPY lib_injection_rails_app /app
39+
40+
# Replace the incompatible bigdecimal version constraint
41+
RUN sed -i "s|gem 'bigdecimal', '~> 1.2', '>= 1.2.7'|gem 'bigdecimal', '>= 3.1.0'|" Gemfile
42+
# Add/replace nio4r constraint
43+
RUN grep -q "gem 'nio4r'" Gemfile || echo "gem 'nio4r', '>= 2.5.9'" >> Gemfile
44+
45+
# Install gems
46+
RUN bundle install
47+
48+
# Set entrypoint
49+
ENTRYPOINT ["/bin/bash", "-c"]
50+
51+
CMD ["bin/rails server -b 0.0.0.0 -p 18080"]

utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ services:
1212
healthcheck:
1313
test: "curl -f http://localhost:8080"
1414

15+
ruby_3_4:
16+
env_file: "scenario_app.env"
17+
image: system-tests/ruby_3_4:latest
18+
restart: always
19+
build:
20+
context: .
21+
dockerfile: Dockerfile.ruby_3_4
22+
healthcheck:
23+
test: "curl -f http://localhost:18080/"
24+
25+
ruby_3_3:
26+
env_file: "scenario_app.env"
27+
image: system-tests/ruby_3_3:latest
28+
restart: always
29+
build:
30+
context: .
31+
dockerfile: Dockerfile.ruby_3_3
32+
healthcheck:
33+
test: "curl -f http://localhost:18080/"
34+
1535
ruby_3_2:
1636
env_file: "scenario_app.env"
1737
image: system-tests/ruby_3_2:latest

utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ http {
99
'"$request" $status $upstream_addr '
1010
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
1111

12+
upstream ruby_3_4_app {
13+
server ruby_3_4:18080;
14+
}
15+
upstream ruby_3_3_app {
16+
server ruby_3_2:18080;
17+
}
1218
upstream ruby_3_2_app {
1319
server ruby_3_2:18080;
1420
}

0 commit comments

Comments
 (0)