Skip to content

Commit 7a68587

Browse files
committed
Add Ruby 2.6 onboarding container
1 parent 0fc3a3e commit 7a68587

File tree

8 files changed

+103
-0
lines changed

8 files changed

+103
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ weblog:
2222
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_3_0-alpine
2323
- name: copy-ruby2_7-app-dockerfile
2424
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_7-alpine
25+
- name: copy-ruby2_6-app-dockerfile
26+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.ruby_2_6-alpine
2527
- name: copy-reverseproxy-dockerfile
2628
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multialpine/Dockerfile.reverseproxy
2729
- name: copy-reverseproxy-conf

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ weblog:
2222
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_3_0
2323
- name: copy-ruby2_7-app-dockerfile
2424
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_7
25+
- name: copy-ruby2_6-app-dockerfile
26+
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.ruby_2_6
2527
- name: copy-reverseproxy-dockerfile
2628
local_path: utils/build/virtual_machine/weblogs/ruby/test-app-ruby-multicontainer/Dockerfile.reverseproxy
2729
- name: copy-reverseproxy-conf
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:2.6-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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ services:
7171
dockerfile: Dockerfile.ruby_2_7-alpine
7272
healthcheck:
7373
test: "curl -f http://localhost:18080"
74+
75+
ruby_2_6:
76+
env_file: "scenario_app.env"
77+
image: system-tests/ruby_2_6:latest
78+
restart: always
79+
build:
80+
context: .
81+
dockerfile: Dockerfile.ruby_2_6-alpine
82+
healthcheck:
83+
test: "curl -f http://localhost:18080"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ http {
2727
upstream ruby_2_7_app {
2828
server ruby_2_7:18080;
2929
}
30+
upstream ruby_2_6_app {
31+
server ruby_2_6:18080;
32+
}
3033
server {
3134
listen 8080;
3235
access_log /var/log/nginx/access.log compression;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM public.ecr.aws/docker/library/ruby:2.6
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+
# Install gems
41+
RUN bundle install
42+
43+
# Set entrypoint
44+
ENTRYPOINT ["/bin/bash", "-c"]
45+
46+
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ services:
7171
dockerfile: Dockerfile.ruby_2_7
7272
healthcheck:
7373
test: "curl -f http://localhost:18080/"
74+
75+
ruby_2_6:
76+
env_file: "scenario_app.env"
77+
image: system-tests/ruby_2_6:latest
78+
restart: always
79+
build:
80+
context: .
81+
dockerfile: Dockerfile.ruby_2_6
82+
healthcheck:
83+
test: "curl -f http://localhost:18080/"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ http {
2727
upstream ruby_2_7_app {
2828
server ruby_2_7:18080;
2929
}
30+
upstream ruby_2_6_app {
31+
server ruby_2_6:18080;
32+
}
3033
server {
3134
listen 8080;
3235
access_log /var/log/nginx/access.log compression;

0 commit comments

Comments
 (0)