From 7ebba736cb734069b4b3c7c84b5e35cf7c51acbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Garc=C3=ADa?=
 <dani-garcia@users.noreply.github.com>
Date: Thu, 13 Dec 2018 18:19:26 +0100
Subject: [PATCH] Updated dockerfiles to use compiled vaults

---
 Dockerfile         | 16 +++++-----------
 Dockerfile.aarch64 | 16 +++++-----------
 Dockerfile.alpine  | 16 +++++-----------
 Dockerfile.armv7   | 16 +++++-----------
 4 files changed, 20 insertions(+), 44 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 36936a73..7ab5e507 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,27 +2,21 @@
 # 	https://docs.docker.com/develop/develop-images/multistage-build/
 # 	https://whitfin.io/speeding-up-rust-docker-builds/
 ####################### VAULT BUILD IMAGE  #######################
-FROM node:10-alpine as vault
+FROM alpine as vault
 
 ENV VAULT_VERSION "v2.6.1"
 
-ENV URL "https://github.com/bitwarden/web.git"
+ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
 
 RUN apk add --update-cache --upgrade \
     curl \
-    git \
     tar
 
-RUN git clone -b $VAULT_VERSION --depth 1 $URL web-build
+RUN mkdir /web-build
 WORKDIR /web-build
 
-COPY /docker/set-vault-baseurl.patch /web-build/    
-RUN git apply set-vault-baseurl.patch
-
-RUN npm run sub:init && npm install
-
-RUN npm run dist \
-    && mv build /web-vault
+RUN curl -L $URL | tar xz
+RUN ls
 
 ########################## BUILD IMAGE  ##########################
 # We need to use the Rust build image, because
diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64
index 0c41c119..7cbabf6f 100644
--- a/Dockerfile.aarch64
+++ b/Dockerfile.aarch64
@@ -2,27 +2,21 @@
 # 	https://docs.docker.com/develop/develop-images/multistage-build/
 # 	https://whitfin.io/speeding-up-rust-docker-builds/
 ####################### VAULT BUILD IMAGE  #######################
-FROM node:10-alpine as vault
+FROM alpine as vault
 
 ENV VAULT_VERSION "v2.6.1"
 
-ENV URL "https://github.com/bitwarden/web.git"
+ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
 
 RUN apk add --update-cache --upgrade \
     curl \
-    git \
     tar
 
-RUN git clone -b $VAULT_VERSION --depth 1 $URL web-build
+RUN mkdir /web-build
 WORKDIR /web-build
 
-COPY /docker/set-vault-baseurl.patch /web-build/    
-RUN git apply set-vault-baseurl.patch
-
-RUN npm run sub:init && npm install
-
-RUN npm run dist \
-    && mv build /web-vault
+RUN curl -L $URL | tar xz
+RUN ls
 
 ########################## BUILD IMAGE  ##########################
 # We need to use the Rust build image, because
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
index 9e4e5982..ee51423c 100644
--- a/Dockerfile.alpine
+++ b/Dockerfile.alpine
@@ -2,27 +2,21 @@
 # 	https://docs.docker.com/develop/develop-images/multistage-build/
 # 	https://whitfin.io/speeding-up-rust-docker-builds/
 ####################### VAULT BUILD IMAGE  #######################
-FROM node:10-alpine as vault
+FROM alpine as vault
 
 ENV VAULT_VERSION "v2.6.1"
 
-ENV URL "https://github.com/bitwarden/web.git"
+ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
 
 RUN apk add --update-cache --upgrade \
     curl \
-    git \
     tar
 
-RUN git clone -b $VAULT_VERSION --depth 1 $URL web-build
+RUN mkdir /web-build
 WORKDIR /web-build
 
-COPY /docker/set-vault-baseurl.patch /web-build/    
-RUN git apply set-vault-baseurl.patch
-
-RUN npm run sub:init && npm install
-
-RUN npm run dist \
-    && mv build /web-vault
+RUN curl -L $URL | tar xz
+RUN ls
 
 ########################## BUILD IMAGE  ##########################
 # Musl build image for statically compiled binary
diff --git a/Dockerfile.armv7 b/Dockerfile.armv7
index 28bbe52e..0a8cb28c 100644
--- a/Dockerfile.armv7
+++ b/Dockerfile.armv7
@@ -2,27 +2,21 @@
 # 	https://docs.docker.com/develop/develop-images/multistage-build/
 # 	https://whitfin.io/speeding-up-rust-docker-builds/
 ####################### VAULT BUILD IMAGE  #######################
-FROM node:10-alpine as vault
+FROM alpine as vault
 
 ENV VAULT_VERSION "v2.6.1"
 
-ENV URL "https://github.com/bitwarden/web.git"
+ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
 
 RUN apk add --update-cache --upgrade \
     curl \
-    git \
     tar
 
-RUN git clone -b $VAULT_VERSION --depth 1 $URL web-build
+RUN mkdir /web-build
 WORKDIR /web-build
 
-COPY /docker/set-vault-baseurl.patch /web-build/    
-RUN git apply set-vault-baseurl.patch
-
-RUN npm run sub:init && npm install
-
-RUN npm run dist \
-    && mv build /web-vault
+RUN curl -L $URL | tar xz
+RUN ls
 
 ########################## BUILD IMAGE  ##########################
 # We need to use the Rust build image, because
-- 
GitLab