-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (43 loc) · 2.25 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
FROM ubuntu:18.04
# Install some basic requirements and ensure that everything will work without interaction
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Los_Angeles
RUN \
rm -f /etc/dpkg/dpkg.cfg.d/excludes && \
apt-get update -qq && \
dpkg -l | grep ^ii | cut -d' ' -f3 | xargs apt-get install -qqy --reinstall && \
apt-get install -qqy debmake debhelper git man tzdata mlocate && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
dpkg-reconfigure tzdata
# Build deb files
RUN \
git clone https://github.com/dustinkirkland/hollywood.git && \
sed -i '/^hollywood \(.*\) unreleased;/d' /hollywood/debian/changelog && \
sed -i -e/^hollywood/\{ -e:1 -en\;b1 -e\} -ed /hollywood/debian/changelog && \
VERSION="$(cat /hollywood/debian/changelog | head -n 1 | cut -d '(' -f2 | cut -d '-' -f1)" && \
mv /hollywood "/hollywood_${VERSION}" && \
tar -czvf "hollywood_${VERSION}.orig.tar.gz" "hollywood_${VERSION}" && \
cd "/hollywood_${VERSION}" && \
DEBEMAIL=" " debmake && debuild -us -uc && \
mv "/hollywood_${VERSION}" /hollywood
# Unfortunately, if we install hollywood from the built deb files it won't work correctly...
#RUN dpkg -i /*.deb; apt-get -f install -qqy && \
# So we are using the hollywood executable from /hollywood/bin because the one from the deb files doesn't work correctly.
ENV PATH="/hollywood/bin:${PATH}"
# But now we have to take care of the dependencies ourselves. We extract them with `dpkg -I` from our `deb`s and install them with `apt-get`
RUN \
HOLLYWOOD_DEPENDENCIES=$(dpkg -I /hollywood*.deb | grep 'Depends: ' | tr -d ',' | cut -d ':' -f2) && \
HOLLYWOOD_RECOMMENDS=$(dpkg -I /hollywood*.deb | grep 'Recommends: ' | tr -d ',' | cut -d ':' -f2) && \
WALLSTREET_DEPENDENCIES=$(dpkg -I /hollywood*.deb | grep 'Depends: ' | tr -d ',' | cut -d ':' -f2) && \
WALLSTREET_RECOMMENDS=$(dpkg -I /hollywood*.deb | grep 'Recommends: ' | tr -d ',' | cut -d ':' -f2) && \
apt-get install -qqy $HOLLYWOOD_DEPENDENCIES $HOLLYWOOD_RECOMMENDS $WALLSTREET_DEPENDENCIES $WALLSTREET_RECOMMENDS
# Cleanup
RUN \
ls -la && \
rm -rf /hollywood_* /wallstreet_* && \
apt-get remove -qqy debmake debhelper && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=
ENV TZ=
CMD [ "hollywood" ]