-
-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (59 loc) · 1.52 KB
/
Dockerfile
File metadata and controls
76 lines (59 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# syntax=docker/dockerfile:1
##
## BASE
##
FROM golang:1.19-bullseye as base
# Ignore APT warnings about not having a TTY
ENV DEBIAN_FRONTEND noninteractive
# install build essentials
RUN apt-get update && \
apt-get install -y wget build-essential pkg-config --no-install-recommends
# Install ImageMagick deps
RUN apt-get -q -y install libjpeg-dev libpng-dev libtiff-dev \
libgif-dev libx11-dev --no-install-recommends
ENV IMAGEMAGICK_VERSION=6.9.10-11
# Install ImageMagick
RUN cd && \
wget https://github.com/ImageMagick/ImageMagick6/archive/${IMAGEMAGICK_VERSION}.tar.gz && \
tar xvzf ${IMAGEMAGICK_VERSION}.tar.gz && \
cd ImageMagick* && \
./configure \
--without-magick-plus-plus \
--without-perl \
--disable-openmp \
--with-gvc=no \
--disable-docs && \
make -j$(nproc) && make install && \
ldconfig /usr/local/lib
# Build the app
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
RUN mkdir -p /inputs /outputs
# This is required for test and run, but for develop it ensures we have a build cache
RUN go build -o /out
# Set up environment
ENV AWS_REGION ""
ENV AWS_ROLE_ARN ""
ENV S3_BUCKET ""
##
## TEST
##
FROM base as test
ENTRYPOINT [ "go", "test", "-v" ]
##
## DEVELOP
##
FROM base as develop
RUN mkdir -p /root/.aws /root/.cache/go-build
COPY .bash_history /root/.bash_history
ENTRYPOINT [ "/bin/bash" ]
##
## RUN
##
FROM base as run
WORKDIR /
ENTRYPOINT ["/out"]
CMD ["--input", "/inputs/example.csv", "--output", "/outputs/example-result.csv"]