-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (53 loc) · 1.57 KB
/
Dockerfile
File metadata and controls
71 lines (53 loc) · 1.57 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
FROM ubuntu:18.04
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
ARG EULER_UID
ARG EULER_GID
ARG STACK_RESOLVER
ARG apt_install="apt install --no-install-recommends --yes"
ARG PACKAGE_NAME=ff
ARG USER=ff
ARG GROUP=ff
ARG HOME=/home/$USER
ARG REPO=$HOME/ff-repo
ARG TMP_BIN=$HOME/temp
ARG BUILD_DIRECTORY=$HOME/ff-deb
ARG DEB=$HOME/deb
ARG BIN=$BUILD_DIRECTORY/opt/$PACKAGE_NAME
RUN \
# Check for mandatory build arguments
: "${EULER_UID:?mandatory build argument is missing}" \
: "${EULER_GID:?mandatory build argument is missing}" \
: "${STACK_RESOLVER:?mandatory build argument is missing}"
RUN groupadd -g ${EULER_GID} $GROUP
RUN useradd -m -u ${EULER_UID} -g ${EULER_GID} $USER
RUN mkdir -p $HOME/.stack
RUN mkdir -p $TMP_BIN
RUN mkdir -p $REPO
RUN mkdir -p $BUILD_DIRECTORY
RUN mkdir -p $BIN
RUN mkdir -p $DEB
RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/
RUN apt update
RUN $apt_install lintian fakeroot debhelper git curl tree \
g++ libtinfo-dev zlib1g-dev qt5-default ca-certificates libgmp-dev
WORKDIR $HOME
RUN tree
RUN curl -sSL https://get.haskellstack.org/ | sh
RUN git clone https://github.com/willbasky/ff.git $REPO
RUN chown -R ${EULER_UID}:${EULER_GID} $HOME/
RUN tree
WORKDIR $BUILD_DIRECTORY
COPY ./ff-deb .
# WORKDIR $HOME
# RUN tree
WORKDIR $REPO
RUN stack --allow-different-user --local-bin-path=$TMP_BIN/ install $PACKAGE_NAME
WORKDIR $HOME
RUN cp $TMP_BIN/$PACKAGE_NAME $BIN
RUN tree
WORKDIR $BUILD_DIRECTORY
RUN dpkg-buildpackage -rfakeroot -b -us -uc -d
WORKDIR $HOME
RUN lintian --suppress-tags dir-or-file-in-opt,embedded-library *.deb
RUN cp *.deb $DEB