@@ -8,11 +8,20 @@ ENV SBT_VERIFY_TAG ${SBT_VERIFY_TAG:-v0.4.1}
8
8
ARG MANTIS_TAG
9
9
ENV MANTIS_TAG ${MANTIS_TAG:-phase/iele_testnet}
10
10
11
+ # The command `sbt dist` generates a zip file in the `target/universal` directory.
12
+ # The value of `MANTIS_DIST_ZIP_NAME` must be the name of the generated zip,
13
+ # excluding the extension.
14
+ # So, for example, currently (commit `35e06611`) the `sbt dist` command
15
+ # produces `target/universal/mantis-1.0-daedalus-rc1.zip`, so we can set
16
+ # `MANTIS_DIST_ZIP_NAME` to be `mantis-1.0-daedalus-rc1`.
17
+ # A glob like `mantis-*` also works and is more convenient, since it is invariant
18
+ # with respect to the other part, which dependens on the software version.
11
19
ARG MANTIS_DIST_ZIP_NAME
12
- ENV MANTIS_DIST_ZIP_NAME ${MANTIS_DIST_ZIP_NAME:-mantis-*.zip }
20
+ ENV MANTIS_DIST_ZIP_NAME ${MANTIS_DIST_ZIP_NAME:-mantis-*}
13
21
14
22
# Just install enough to get nix up and running
15
23
RUN apt-get update \
24
+ && apt-get dist-upgrade -y \
16
25
&& apt-get install -y curl bzip2 locales \
17
26
&& locale-gen en_US.UTF-8 \
18
27
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
@@ -22,15 +31,17 @@ RUN apt-get update \
22
31
&& su mantis -c 'curl https://nixos.org/nix/install | sh && . ~/.nix-profile/etc/profile.d/nix.sh && nix-channel --update && tail -n 1 ~/.profile >> ~/.bashrc' \
23
32
&& ln -s /home/mantis/mantis-dist/app /app \
24
33
&& apt-get purge -y curl bzip2 \
25
- && apt-get clean autoremove
34
+ && apt-get clean -y \
35
+ && rm -rf /var/cache/debconf/* /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/*
26
36
27
37
USER mantis
28
38
WORKDIR /home/mantis
29
39
ENV USER mantis
30
40
31
41
# install java, sbt, git, unzip
32
42
RUN . ~/.nix-profile/etc/profile.d/nix.sh \
33
- && nix-env -i openjdk-8u172b02 sbt-1.1.4 git unzip
43
+ && nix-env -i openjdk-8u172b02 sbt-1.1.4 git unzip \
44
+ && nix-collect-garbage
34
45
35
46
# TODO: Could just use a nix-shell and garbage collect (e.g. git, unzip, sbt) after the installations ...
36
47
RUN . ~/.nix-profile/etc/profile.d/nix.sh \
@@ -44,7 +55,7 @@ RUN . ~/.nix-profile/etc/profile.d/nix.sh \
44
55
&& git submodule update --init \
45
56
&& sbt 'set test in Test := {}' dist \
46
57
&& mkdir -p ~/mantis-dist/app \
47
- && unzip -d ~/mantis-dist/app target/universal/$MANTIS_DIST_ZIP_NAME \
58
+ && unzip -d ~/mantis-dist/app target/universal/${ MANTIS_DIST_ZIP_NAME}.zip \
48
59
&& mv ~/mantis-dist/app/*/* ~/mantis-dist/app \
49
60
&& rmdir ~/mantis-dist/app/$MANTIS_DIST_ZIP_NAME \
50
61
&& cd ~ \
0 commit comments