[gbm-web] Switch to multi-stage image
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbm-web] Switch to multi-stage image
- Date: Wed, 16 Sep 2020 10:42:29 +0000 (UTC)
commit a91da641f621e7ae181c50e00dfc82f8ef8497fc
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Wed Sep 16 12:42:09 2020 +0200
Switch to multi-stage image
flat-manager/Dockerfile | 17 +++++++++++++++--
flat-manager/Dockerfile.builder | 12 ------------
2 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/flat-manager/Dockerfile b/flat-manager/Dockerfile
index 6348721..05c19e9 100644
--- a/flat-manager/Dockerfile
+++ b/flat-manager/Dockerfile
@@ -1,3 +1,16 @@
+FROM ubuntu:18.04 as builder
+
+RUN apt-get update && apt-get install -y git libpq-dev curl build-essential libgpgme-dev
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
+ sh rustup.sh -y -q
+
+RUN git clone https://github.com/flatpak/flat-manager.git && cd flat-manager && \
+ git checkout 0.3.7 && /root/.cargo/bin/cargo fetch
+RUN cd flat-manager && /root/.cargo/bin/cargo build --release
+
+ADD gpg-heartbeat.c /gpg-heartbeat.c
+RUN gcc -s /gpg-heartbeat.c $(gpgme-config --libs --cflags) -o /gpg-heartbeat
+
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gnupg2
@@ -6,8 +19,8 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C793BFA2FA577F07 &&
apt-get update && apt-get install -y flatpak ostree libpq5 ca-certificates && \
rm -rf /var/lib/apt/lists/*
-ADD flat-manager /usr/local/bin/flat-manager
-ADD gpg-heartbeat /usr/local/bin/gpg-heartbeat
+COPY --from=builder /flat-manager/target/release/flat-manager /usr/local/bin/flat-manager
+COPY --from=builder /gpg-heartbeat /usr/local/bin/gpg-heartbeat
ENV HOME /srv/gnome-build-meta
EXPOSE 8080
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]