|
| 1 | +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/ruby/.devcontainer/base.Dockerfile |
| 2 | + |
| 3 | +# [Choice] Ruby version: 3, 3.0, 2, 2.7, 2.6 |
| 4 | +ARG VARIANT="3.0" |
| 5 | +FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} |
| 6 | + |
| 7 | +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 |
| 8 | +ARG NODE_VERSION="none" |
| 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 |
| 10 | + |
| 11 | +# [Optional] Uncomment this section to install additional OS packages. |
| 12 | +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
| 13 | + && apt-get -y install --no-install-recommends \ |
| 14 | + mariadb-server libmariadbclient-dev \ |
| 15 | + postgresql postgresql-client postgresql-contrib libpq-dev \ |
| 16 | + redis-server memcached \ |
| 17 | + ffmpeg mupdf mupdf-tools libvips poppler-utils |
| 18 | + |
| 19 | + |
| 20 | +ARG IMAGEMAGICK_VERSION="7.1.0-5" |
| 21 | +RUN wget -qO /tmp/im.tar.xz https://imagemagick.org/download/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.xz \ |
| 22 | + && wget -qO /tmp/im.sig https://imagemagick.org/download/releases/ImageMagick-$IMAGEMAGICK_VERSION.tar.xz.asc \ |
| 23 | + && gpg --batch --keyserver keyserver.ubuntu.com --recv 89AB63D48277377A \ |
| 24 | + && gpg --batch --verify /tmp/im.sig /tmp/im.tar.xz \ |
| 25 | + && tar xJf /tmp/im.tar.xz -C /tmp \ |
| 26 | + && cd /tmp/ImageMagick-$IMAGEMAGICK_VERSION \ |
| 27 | + && ./configure --with-rsvg && make -j 9 && make install \ |
| 28 | + && ldconfig /usr/local/lib \ |
| 29 | + && rm -rf /tmp/* |
| 30 | + |
| 31 | + |
| 32 | +# [Optional] Uncomment this line to install additional gems. |
| 33 | +# Add the Rails main Gemfile and install the gems. This means the gem install can be done |
| 34 | +# during build instead of on start. When a fork or branch has different gems, we still have an |
| 35 | +# advantage due to caching of the other gems. |
| 36 | +RUN mkdir -p /tmp/rails |
| 37 | +COPY Gemfile Gemfile.lock RAILS_VERSION rails.gemspec package.json yarn.lock /tmp/rails/ |
| 38 | +COPY actioncable/actioncable.gemspec /tmp/rails/actioncable/ |
| 39 | +COPY actionmailbox/actionmailbox.gemspec /tmp/rails/actionmailbox/ |
| 40 | +COPY actionmailer/actionmailer.gemspec /tmp/rails/actionmailer/ |
| 41 | +COPY actionpack/actionpack.gemspec /tmp/rails/actionpack/ |
| 42 | +COPY actiontext/actiontext.gemspec /tmp/rails/actiontext/ |
| 43 | +COPY actionview/actionview.gemspec /tmp/rails/actionview/ |
| 44 | +COPY activejob/activejob.gemspec /tmp/rails/activejob/ |
| 45 | +COPY activemodel/activemodel.gemspec /tmp/rails/activemodel/ |
| 46 | +COPY activerecord/activerecord.gemspec /tmp/rails/activerecord/ |
| 47 | +COPY activestorage/activestorage.gemspec /tmp/rails/activestorage/ |
| 48 | +COPY activesupport/activesupport.gemspec /tmp/rails/activesupport/ |
| 49 | +COPY railties/railties.gemspec /tmp/rails/railties/ |
| 50 | +RUN cd /tmp/rails \ |
| 51 | + && bundle install \ |
| 52 | + && yarn install \ |
| 53 | + && rm -rf /tmp/rails |
| 54 | + |
| 55 | +# [Optional] Uncomment this line to install global node packages. |
| 56 | +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 |
0 commit comments