77#
88# # Generate the build image to simplify local development
99# docker build --rm -t uolibraries/rais:build --target build -f ./docker/Dockerfile .
10- FROM fedora:32 AS build
10+ FROM golang:1 AS build
1111LABEL maintainer="Jeremy Echols <jechols@uoregon.edu>"
1212
1313# Install all the build dependencies
14- RUN dnf update -y
15- RUN dnf upgrade -y
16- RUN dnf install -y openjpeg2-devel
17- RUN dnf install -y ImageMagick-devel
18- RUN dnf install -y git
19- RUN dnf install -y gcc
20- RUN dnf install -y make
21- RUN dnf install -y tar
22- RUN dnf install -y findutils
23-
24- # Installing GraphicsMagick is wholly unnecessary, but helps when using the
25- # build box for things like converting images. Since opj2_encode doesn't
26- # support all formats, and ImageMagick has been iffy with some conversions for
27- # us, "gm convert" is a handy fallback. As this is a multi-stage dockerfile,
28- # this installation doesn't hurt the final production docker image.
29- RUN dnf install -y GraphicsMagick
30-
31- # Go comes after other installs to avoid re-pulling the more expensive
32- # dependencies when changing Go versions
33- RUN curl -L https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz > /tmp/go.tgz
34- RUN cd /opt && tar -xzf /tmp/go.tgz
35-
36- # "Install" Go
37- RUN mkdir -p /usr/local/go
38- ENV GOPATH /usr/local/go
39- ENV GOROOT /opt/go
40- ENV PATH /opt/go/bin:/usr/local/go/bin:$PATH
14+ RUN apt-get update -y && apt-get upgrade -y && \
15+ apt-get install -y libopenjp2-7-dev libmagickcore-dev git gcc make tar findutils
4116
4217# Make sure the build box can lint code
4318RUN go get -u golang.org/x/lint/golint
@@ -59,16 +34,19 @@ RUN make
5934# Manually build the ImageMagick plugin since we exclude it by default
6035RUN make bin/plugins/imagick-decoder.so
6136
37+
38+
6239# Production image just installs runtime deps and copies in the binaries
63- FROM fedora:30 AS production
40+ FROM debian:buster AS production
6441LABEL maintainer="Jeremy Echols <jechols@uoregon.edu>"
6542
6643# Stolen from mariadb dockerfile: add our user and group first to make sure
6744# their IDs get assigned consistently
6845RUN groupadd -r rais && useradd -r -g rais rais
6946
70- # Deps
71- RUN dnf update -y && dnf upgrade -y && dnf install -y openjpeg2 ImageMagick
47+ # Install the core dependencies needed for both build and production
48+ RUN apt-get update -y && apt-get upgrade -y && \
49+ apt-get install -y libopenjp2-7 imagemagick
7250
7351ENV RAIS_TILEPATH /var/local/images
7452ENV RAIS_PLUGINS "*.so"
0 commit comments