This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
97 lines (78 loc) · 1.65 KB
/
Dockerfile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# temporary image
FROM ubuntu:19.04 AS aerc_builder
# aerc version
ARG VERSION=master
# metadata
LABEL maintainer="Stefan Fischer <sfischer13@ymail.com>"
# apt-get settings
ARG DEBIAN_FRONTEND=noninteractive
# install packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
publicsuffix \
gcc \
git \
golang-1.12-go \
libc6-dev \
libnotmuch-dev \
make \
scdoc \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# PATH
ENV PATH /usr/lib/go-1.12/bin:$PATH
# aerc location
RUN mkdir /local/
WORKDIR /local/
# clone repository
RUN git clone https://git.sr.ht/~sircmpwn/aerc aerc.git
# install aerc
WORKDIR /local/aerc.git/
RUN git checkout $VERSION
ENV PREFIX /local
RUN GOFLAGS=-tags=notmuch make
RUN make install
# cleaning
WORKDIR /local/
RUN rm -r aerc.git/
# final image
FROM ubuntu:18.04 AS aerc
# metadata
LABEL maintainer="Stefan Fischer <sfischer13@ymail.com>"
# install packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
publicsuffix \
catimg \
dante-client \
gawk \
notmuch \
man \
pass \
python3 \
python3-colorama \
w3m \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# copy tagger from previous stage
COPY --from=aerc_builder /local/ /local/
# set path
ENV PATH /local/bin:$PATH
ENV MANPATH /local/share/man:$MANPATH
# add non-root user
RUN groupadd docker \
&& useradd -g docker -m docker
# change owner
RUN chown -R docker:docker /local/
# default command
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["aerc"]
# default working directory
WORKDIR /home/docker/
# default user
USER docker