Skip to content

Commit

Permalink
Base image installation moved to separate Dockerfile (#558)
Browse files Browse the repository at this point in the history
Base image installation moved to separate Dockerfile; update ci-cache.yml
  • Loading branch information
dolsysmith authored Aug 8, 2024
1 parent f883d24 commit e0cf6ba
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 41 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
branches:
- master
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
#env:
# REGISTRY: ghcr.io
env:
REGISTRY: ghcr.io
jobs:
CI:
runs-on: ubuntu-latest
Expand All @@ -19,12 +19,12 @@ jobs:
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Log in to the Container registry
# uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create scholarspace folders
run: |
mkdir -p /opt/scholarspace
Expand Down
34 changes: 1 addition & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
# When upgrading passenger-ruby image version, make sure to update passenger version in Gemfile
FROM phusion/passenger-ruby27:2.5.0
FROM ghcr.io/gwu-libraries/scholarspace-base:latest

LABEL org.opencontainers.image.source=https://github.com/gwu-libraries/scholarspace-hyrax
LABEL org.opencontainers.image.description="Dockerized version of our Hyrax application, GW ScholarSpace"
LABEL org.opencontainers.image.licenses="MIT"

RUN apt update && apt install -y libpq-dev unzip clamav-daemon curl libreoffice libcurl4-openssl-dev ffmpeg gnupg2 libxml2 libxml2-dev wget

RUN apt update && apt build-dep -y imagemagick

RUN apt install -y checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt \
&& wget https://www.imagemagick.org/archive/releases/ImageMagick-7.1.1-13.tar.xz \
&& tar xf ImageMagick-7.1.1-13.tar.xz \
&& cd ImageMagick-7.1.1-13 \
&& ./configure --enable-shared --with-modules --with-gslib \
&& make \
&& make install \
&& ldconfig /usr/local/lib \
&& identify -version \
&& rm /opt/ImageMagick-7.1.1-13.tar.xz

# FITS install
WORKDIR /usr/local/bin

RUN wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip \
&& unzip fits-1.5.0.zip -d fits-1.5.0 \
&& rm fits-1.5.0.zip \
&& chmod a+x fits-1.5.0/fits*.sh

# Uninstall Ruby version from image and install our version
# bash -lc is necessary per the configuration of the base image
RUN bash -lc "rvm remove ruby-2.7.7 && rvm install ruby-2.7.3"

# Hyrax directories
RUN mkdir -p /opt/scholarspace/scholarspace-hyrax \
&& mkdir -p /opt/scholarspace/scholarspace-tmp \
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# When upgrading passenger-ruby image version, make sure to update passenger version in Gemfile
FROM phusion/passenger-ruby27:2.5.0

LABEL org.opencontainers.image.source=https://github.com/gwu-libraries/scholarspace-hyrax

RUN apt update && apt install -y libpq-dev unzip clamav-daemon curl libreoffice libcurl4-openssl-dev ffmpeg gnupg2 libxml2 libxml2-dev wget

RUN apt update && apt build-dep -y imagemagick

RUN apt install -y checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt \
&& wget https://www.imagemagick.org/archive/releases/ImageMagick-7.1.1-13.tar.xz \
&& tar xf ImageMagick-7.1.1-13.tar.xz \
&& cd ImageMagick-7.1.1-13 \
&& ./configure --enable-shared --with-modules --with-gslib \
&& make \
&& make install \
&& ldconfig /usr/local/lib \
&& identify -version \
&& rm /opt/ImageMagick-7.1.1-13.tar.xz

# FITS install
WORKDIR /usr/local/bin

RUN wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip \
&& unzip fits-1.5.0.zip -d fits-1.5.0 \
&& rm fits-1.5.0.zip \
&& chmod a+x fits-1.5.0/fits*.sh

# Uninstall Ruby version from image and install our version
# bash -lc is necessary per the configuration of the base image
RUN bash -lc "rvm remove ruby-2.7.7 && rvm install ruby-2.7.3"

0 comments on commit e0cf6ba

Please sign in to comment.