1
1
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/ruby/.devcontainer/base.Dockerfile
2
2
3
3
# [Choice] Ruby version: 3, 3.3, 3.2, 3.1, 3.0, 2, 2.7, 2.6
4
- ARG VARIANT="3.3"
5
- FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}
6
-
7
- # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8
- ARG NODE_VERSION="lts/*"
9
- RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1" ; fi
4
+ ARG VARIANT="3.3.0"
5
+ FROM ghcr.io/rails/devcontainer/images/ruby:${VARIANT}
10
6
11
7
# [Optional] Uncomment this section to install additional OS packages.
12
8
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13
9
&& apt-get -y install --no-install-recommends \
14
10
mariadb-client libmariadb-dev \
15
11
postgresql-client postgresql-contrib libpq-dev \
16
- ffmpeg mupdf mupdf-tools libvips poppler-utils
17
-
18
-
19
- ARG IMAGEMAGICK_VERSION="7.1.0-5"
20
- RUN wget -qO /tmp/im.tar.xz https://imagemagick.org/archive/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.xz \
21
- && wget -qO /tmp/im.sig https://imagemagick.org/archive/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.xz.asc \
22
- && gpg --batch --keyserver keyserver.ubuntu.com --recv 89AB63D48277377A \
23
- && gpg --batch --verify /tmp/im.sig /tmp/im.tar.xz \
24
- && tar xJf /tmp/im.tar.xz -C /tmp \
25
- && cd /tmp/ImageMagick-$IMAGEMAGICK_VERSION \
26
- && ./configure --with-rsvg && make -j 9 && make install \
27
- && ldconfig /usr/local/lib \
28
- && rm -rf /tmp/*
12
+ ffmpeg mupdf mupdf-tools libvips-dev poppler-utils \
13
+ libxml2-dev sqlite3 imagemagick
29
14
30
15
# Add the Rails main Gemfile and install the gems. This means the gem install can be done
31
16
# during build instead of on start. When a fork or branch has different gems, we still have an
@@ -44,8 +29,11 @@ COPY activerecord/activerecord.gemspec /tmp/rails/activerecord/
44
29
COPY activestorage/activestorage.gemspec /tmp/rails/activestorage/
45
30
COPY activesupport/activesupport.gemspec /tmp/rails/activesupport/
46
31
COPY railties/railties.gemspec /tmp/rails/railties/
32
+ # Docker does not support COPY as users other than root. So we need to chown this dir so we
33
+ # can bundle as vscode user and then remove the tmp dir
34
+ RUN chown -R vscode:vscode /tmp/rails
35
+ USER vscode
47
36
RUN cd /tmp/rails \
48
- && bundle install \
49
- && yarn install \
37
+ && /home/vscode/.rbenv/shims/bundle install \
50
38
&& rm -rf /tmp/rails
51
- RUN chown -R vscode:vscode /usr/local/rvm
39
+
0 commit comments