1- ARG IMAGE="bitnami/ruby"
2- ARG TAG="latest"
1+ ARG IMAGE="ruby"
2+ ARG VERSION="3.4.5"
3+ ARG DISTRO="slim-bookworm"
34
4- FROM ${IMAGE}:${TAG}
5+ FROM ${IMAGE}:${VERSION}-${DISTRO} AS build
56
6- USER root
7- RUN apt-get update && apt-get install -y \
7+ RUN apt-get update && apt-get install -y --no-install-recommends \
8+ sudo \
89 gnupg \
910 git \
1011 curl \
1112 wget \
12- zsh \
13- vim \
1413 build-essential \
15- sudo \
14+ pkg-config \
1615 libssl-dev \
1716 libreadline-dev \
1817 zlib1g-dev \
@@ -22,31 +21,74 @@ RUN apt-get update && apt-get install -y \
2221 libncurses5-dev \
2322 libffi-dev \
2423 libgdbm-dev \
24+ sqlite3 \
25+ nodejs \
26+ npm \
2527 && apt-get clean \
2628 && rm -rf /var/lib/apt/lists/*
2729
28- RUN groupadd --gid 1000 sentry \
29- && useradd --uid 1000 --gid sentry --shell /bin/zsh --create-home sentry
30-
31- # Add sentry to sudoers with NOPASSWD option
3230RUN echo "sentry ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/sentry \
3331 && chmod 0440 /etc/sudoers.d/sentry
3432
33+ RUN groupadd --gid 1000 sentry \
34+ && useradd --uid 1000 --gid sentry --shell /bin/bash --create-home sentry
35+
3536WORKDIR /workspace/sentry
3637
3738RUN chown -R sentry:sentry /workspace/sentry
38- RUN mkdir /workspace/gems && chown -R sentry:sentry /workspace/gems
3939
40- ARG TAG=latest
41- ARG GEM_HOME="/workspace/gems/${TAG}"
40+ ARG VERSION
41+ ARG GEM_HOME="/workspace/gems/${VERSION}"
42+
43+ RUN mkdir /workspace/gems && chown -R sentry:sentry /workspace/gems
4244
4345ENV LANG=C.UTF-8 \
4446 BUNDLE_JOBS=4 \
4547 BUNDLE_RETRY=3 \
46- GEM_HOME=/workspace/gems/${TAG } \
48+ GEM_HOME=/workspace/gems/${VERSION } \
4749 PATH=$PATH:${GEM_HOME}/bin \
4850 REDIS_HOST=redis
4951
52+ FROM build AS dev
53+
54+ RUN apt-get update && apt-get install -y --no-install-recommends \
55+ chromium \
56+ chromium-driver \
57+ && apt-get clean \
58+ && rm -rf /var/lib/apt/lists/*
59+
60+ USER sentry
61+
62+ COPY entrypoint-sentry-dev.sh /workspace/entrypoint.sh
63+
64+ ENTRYPOINT ["/workspace/entrypoint.sh" ]
65+
66+ FROM build AS test
67+
68+ RUN apt-get update && apt-get install -y --no-install-recommends \
69+ chromium \
70+ chromium-driver \
71+ && apt-get clean \
72+ && rm -rf /var/lib/apt/lists/*
73+
74+ USER sentry
75+
76+ COPY entrypoint-sentry-test.sh /workspace/entrypoint.sh
77+
78+ ENTRYPOINT ["/workspace/entrypoint.sh" ]
79+
80+ FROM build AS rails-mini
81+
82+ USER sentry
83+
84+ COPY entrypoint-rails-mini.sh /workspace/entrypoint.sh
85+
86+ ENTRYPOINT ["/workspace/entrypoint.sh" ]
87+
88+ FROM build AS svelte-mini
89+
5090USER sentry
5191
52- CMD ["ruby" , "--version" ]
92+ COPY entrypoint-svelte-mini.sh /workspace/entrypoint.sh
93+
94+ ENTRYPOINT ["/workspace/entrypoint.sh" ]
0 commit comments