From ab4988ac38b51d7bb5f172e30f7b7ea1bb1d4f66 Mon Sep 17 00:00:00 2001 From: Duy Do Date: Mon, 6 Nov 2023 20:53:08 +0700 Subject: [PATCH] . --- scripts/build_images.bash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/build_images.bash diff --git a/scripts/build_images.bash b/scripts/build_images.bash new file mode 100755 index 00000000..74dff5e9 --- /dev/null +++ b/scripts/build_images.bash @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail + +mkdir -p ./target/container + +time docker run --rm --name BUILD-SPACE \ + -v "${PWD}":/build:Z,ro \ + -v "${PWD}/target/container":/build/target:Z,rw \ + -v SPACE-CARGO:/usr/local/cargo \ + -e RUSTFLAGS="-C target-cpu=haswell" \ + rust:latest \ + bash -c " + cd /build/ + cargo build --release -p flow-server + " + +mkdir -p ./target/container_bin +cp ./target/container/release/flow-server ./target/container_bin +strip ./target/container_bin/* + +docker build -t flow-server:latest -f ./crates/flow-server/Dockerfile ./target/container_bin