Skip to content

Commit 371f52b

Browse files
Fix debian archive for old ruby image versions
1 parent e59a27c commit 371f52b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Base image
2-
ARG RUBY_IMAGE
2+
ARG RUBY_IMAGE=2.4
33
FROM ${RUBY_IMAGE}
44

5+
ARG RUBY_IMAGE
6+
57
# Env arguments
68
ENV \
79
APP_WORKDIR="/var/app" \
@@ -24,6 +26,12 @@ COPY build/ /usr/local/bin/
2426
# Reset to root user
2527
USER root
2628

29+
# Fix debian archive for old ruby versions
30+
RUN if [ ${RUBY_IMAGE} = ruby:2.4 ] || [ ${RUBY_IMAGE} = elasticobservability/jruby:9.2-13-jdk ]; then \
31+
sed -i 's|http://deb\.debian\.org/debian|https://archive\.debian\.org/debian|g' /etc/apt/sources.list && \
32+
sed -i 's|http://security\.debian\.org/debian-security|https://archive\.debian\.org/debian-security|g' /etc/apt/sources.list; \
33+
fi
34+
2735
# Install dependencies and upgrade ruby system
2836
RUN \
2937
apt-get update > /dev/null \

0 commit comments

Comments
 (0)