This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruby.docker
43 lines (30 loc) · 1.59 KB
/
ruby.docker
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
## REGISTRY CONFIGURATION ######################################################
ARG REGISTRY="docker.io"
## INSTALLER ###################################################################
FROM ${REGISTRY}/essentialkaos/rbinstall:ol8 as installer
ARG RUBY_VERSION=3.2.0
ARG WITH_STATIC=no
RUN rbinstall ${RUBY_VERSION} && \
if [ "${WITH_STATIC}" != "no" ] ; then rm -f /usr/local/rbenv/versions/${RUBY_VERSION}/lib/libruby-static.a ; fi
## FINAL IMAGE #################################################################
FROM ${REGISTRY}/essentialkaos/oraclelinux:8
ARG RUBY_VERSION=3.2.0
ARG WITH_GCC=no
LABEL org.opencontainers.image.title="rbinstall-ruby" \
org.opencontainers.image.description="RBEnv with prebuilt Ruby (${RUBY_VERSION})" \
org.opencontainers.image.vendor="ESSENTIAL KAOS" \
org.opencontainers.image.authors="Anton Novojilov" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.url="https://kaos.sh/rbinstall" \
org.opencontainers.image.source="https://github.com/essentialkaos/rbinstall"
COPY --from=installer /usr/local/rbenv/versions/${RUBY_VERSION} \
/usr/local/rbenv/versions/${RUBY_VERSION}
RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install rbenv libyaml && \
if [ "${WITH_GCC}" != "no" ] ; then dnf -y -q install gcc ; fi && \
dnf -y -q module disable "*" && \
dnf clean all && rm -rf /var/cache/dnf /var/log/dnf.* && \
source /etc/profile.d/rbenv.sh && \
rbenv global ${RUBY_VERSION}
ENV PATH /usr/local/rbenv/shims:$PATH
CMD [ "irb" ]