|
1 | 1 | FROM snapcore/snapcraft AS snapcraft
|
2 | 2 | # Using multi-stage dockerfile to obtain snapcraft binary
|
3 | 3 |
|
| 4 | +FROM ubuntu:bionic AS flutterbuilder |
| 5 | +RUN apt-get update \ |
| 6 | + && apt-get install -y \ |
| 7 | + git curl unzip |
| 8 | +# Install Flutter from the beta channel |
| 9 | +RUN git clone --single-branch --depth=1 --branch beta https://github.com/flutter/flutter /opt/flutter 2>&1 \ |
| 10 | + && /opt/flutter/bin/flutter doctor -v |
| 11 | + |
4 | 12 | FROM ubuntu:bionic AS xarbuilder
|
5 | 13 | RUN apt-get update \
|
6 | 14 | && apt-get install -y \
|
7 |
| - wget tar libssl1.0-dev libxml2-dev make g++ |
8 |
| -RUN cd /tmp \ |
9 |
| - && wget https://github.com/downloads/mackyle/xar/xar-1.6.1.tar.gz 2>&1 \ |
10 |
| - && tar -zxvf xar-1.6.1.tar.gz 2>&1 \ |
11 |
| - && mv xar-1.6.1 xar \ |
12 |
| - && cd xar \ |
| 15 | + git libssl1.0-dev libxml2-dev make g++ autoconf |
| 16 | +RUN git clone --single-branch --depth=1 --branch xar-1.6.1 https://github.com/mackyle/xar 2>&1 \ |
| 17 | + && cd xar/xar \ |
| 18 | + && ./autogen.sh --noconfigure \ |
13 | 19 | && ./configure 2>&1 \
|
14 | 20 | && make 2>&1 \
|
15 | 21 | && make install 2>&1
|
16 | 22 |
|
17 |
| -FROM dockercore/golang-cross:1.13.10 AS hover |
| 23 | +FROM ubuntu:bionic AS bomutilsbuilder |
| 24 | +RUN apt-get update \ |
| 25 | + && apt-get install -y \ |
| 26 | + git make g++ |
| 27 | +RUN git clone --single-branch --depth=1 --branch 0.2 https://github.com/hogliux/bomutils 2>&1 \ |
| 28 | + && cd bomutils \ |
| 29 | + && make 2>&1 \ |
| 30 | + && make install 2>&1 |
18 | 31 |
|
19 |
| -# Add dart apt repository |
20 |
| -RUN wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - 2>&1 \ |
21 |
| - && wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list |
| 32 | +# Fixed using https://github.com/AppImage/AppImageKit/issues/828 |
| 33 | +FROM ubuntu:bionic as appimagebuilder |
| 34 | +RUN apt-get update \ |
| 35 | + && apt-get install -y \ |
| 36 | + curl |
| 37 | +RUN cd /opt \ |
| 38 | + && curl -LO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \ |
| 39 | + && chmod a+x appimagetool-x86_64.AppImage \ |
| 40 | + && sed 's|AI\x02|\x00\x00\x00|g' -i appimagetool-x86_64.AppImage \ |
| 41 | + && ./appimagetool-x86_64.AppImage --appimage-extract \ |
| 42 | + && mv squashfs-root appimagetool |
| 43 | + |
| 44 | +FROM dockercore/golang-cross:1.13.10 AS hover |
22 | 45 |
|
23 | 46 | # Install dependencies via apt
|
24 | 47 | RUN apt-get update \
|
25 |
| - && apt-get upgrade -y \ |
26 | 48 | && apt-get install -y \
|
27 |
| - # why is gnupg-agent needed? Can this be removed?? |
28 |
| - gnupg-agent \ |
29 |
| - # for what command are these dependencies?? |
| 49 | + # dependencies for compiling linux |
30 | 50 | libgl1-mesa-dev xorg-dev \
|
31 |
| - # dependencies for flutter |
32 |
| - dart unzip \ |
33 | 51 | # dependencies for darwin-bundle
|
34 | 52 | icnsutils \
|
35 | 53 | # dependencies for darwin-dmg
|
36 | 54 | genisoimage \
|
37 | 55 | # dependencies for darwin-pkg
|
38 | 56 | cpio git \
|
39 |
| - # dependencies for linux-appimage |
40 |
| - libglib2.0-0 curl file \ |
41 | 57 | # dependencies for linux-rpm
|
42 | 58 | rpm \
|
43 |
| - # dependencies for linux-snap |
44 |
| - locales \ |
45 | 59 | # dependencies for windows-msi
|
46 | 60 | wixl imagemagick \
|
47 |
| - && rm -rf /var/lib/apt/lists/* \ |
48 |
| - && ln -sf /usr/lib/dart/bin/pub /usr/bin/pub |
| 61 | + && rm -rf /var/lib/apt/lists/* |
| 62 | + |
| 63 | +COPY --from=snapcraft /snap /snap |
| 64 | +ENV PATH="/snap/bin:$PATH" |
| 65 | +ENV SNAP="/snap/snapcraft/current" |
| 66 | +ENV SNAP_NAME="snapcraft" |
| 67 | +ENV SNAP_ARCH="amd64" |
49 | 68 |
|
50 |
| -# Install darwin-pkg dependencies |
51 |
| -# TODO, optimization: make bomutils in a separate stage, copy binaries/libs, like xar. |
52 |
| -RUN cd /tmp \ |
53 |
| - && git clone https://github.com/hogliux/bomutils 2>&1 \ |
54 |
| - && cd bomutils \ |
55 |
| - && make 2>&1 \ |
56 |
| - && make install 2>&1 |
57 | 69 | COPY --from=xarbuilder /usr/local/bin/xar /usr/local/bin/xar
|
58 | 70 | COPY --from=xarbuilder /usr/local/lib/libxar.so.1 /usr/local/lib/libxar.so.1
|
59 | 71 | COPY --from=xarbuilder /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
|
60 | 72 |
|
61 |
| -# Install linux-appimage dependencies |
62 |
| -# Fixed using https://github.com/AppImage/AppImageKit/issues/828 |
63 |
| -RUN cd /opt \ |
64 |
| - && curl -LO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \ |
65 |
| - && chmod a+x appimagetool-x86_64.AppImage \ |
66 |
| - && sed 's|AI\x02|\x00\x00\x00|g' -i appimagetool-x86_64.AppImage \ |
67 |
| - && ./appimagetool-x86_64.AppImage --appimage-extract \ |
68 |
| - && mv squashfs-root appimagetool \ |
69 |
| - && rm appimagetool-x86_64.AppImage |
70 |
| -ENV PATH=/opt/appimagetool/usr/bin:$PATH |
| 73 | +COPY --from=bomutilsbuilder /usr/bin/mkbom /usr/bin/mkbom |
71 | 74 |
|
72 |
| -# Install linux-snap dependencies (based on https://hub.docker.com/r/snapcore/snapcraft/dockerfile) |
73 |
| -COPY --from=snapcraft /snap/core /snap/core |
74 |
| -COPY --from=snapcraft /snap/snapcraft /snap/snapcraft |
75 |
| -COPY --from=snapcraft /snap/bin/snapcraft /snap/bin/snapcraft |
76 |
| -# RUN locale-gen en_US.UTF-8 # TODO: remove locales from apt install above or re-enable these env vars |
77 |
| -# ENV LANG="en_US.UTF-8" |
78 |
| -# ENV LANGUAGE="en_US:en" |
79 |
| -# ENV LC_ALL="en_US.UTF-8" |
80 |
| -ENV PATH="/snap/bin:$PATH" |
81 |
| -ENV SNAP="/snap/snapcraft/current" |
82 |
| -ENV SNAP_NAME="snapcraft" |
83 |
| -ENV SNAP_ARCH="amd64" |
84 |
| -# RUN dpkg-reconfigure locales |
| 75 | +COPY --from=appimagebuilder /opt/appimagetool /opt/appimagetool |
| 76 | +ENV PATH=/opt/appimagetool/usr/bin:$PATH |
85 | 77 |
|
86 | 78 | # TODO: Add pacman pkg packaging
|
87 | 79 |
|
88 |
| -# Install Flutter from the beta channel |
89 |
| -RUN git clone --single-branch --depth=1 --branch beta https://github.com/flutter/flutter /opt/flutter 2>&1 \ |
90 |
| - && ln -sf /opt/flutter/bin/flutter /usr/bin/flutter \ |
91 |
| - && flutter doctor -v |
| 80 | +COPY --from=flutterbuilder /opt/flutter /opt/flutter |
| 81 | +RUN ln -sf /opt/flutter/bin/flutter /usr/bin/flutter |
92 | 82 |
|
93 | 83 | # Build hover
|
94 | 84 | WORKDIR /go/src/app
|
|
0 commit comments