mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 03:01:07 +00:00
Improve docker image size with a 2 stages image (#463)
* Improve docker image size with a 2 stages image * Minor doc updates * Fix and reduce size of the docker image * Fix paths in scripts
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script assumes that all pre-requisites are installed.
|
||||
|
||||
set -e
|
||||
|
||||
PROJECT_ROOT=`git rev-parse --show-toplevel`
|
||||
source `dirname "$0"`/common.sh
|
||||
|
||||
export CARGO_INCREMENTAL=0
|
||||
|
||||
# Save current directory.
|
||||
pushd .
|
||||
|
||||
cd $ROOT
|
||||
|
||||
for DEMO in "${DEMOS[@]}"
|
||||
do
|
||||
echo "*** Building wasm binaries in $DEMO"
|
||||
cd "$PROJECT_ROOT/$DEMO"
|
||||
|
||||
./build.sh
|
||||
|
||||
cd - >> /dev/null
|
||||
done
|
||||
|
||||
# Restore initial directory.
|
||||
popd
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script assumes that all pre-requisites are installed.
|
||||
|
||||
set -e
|
||||
|
||||
PROJECT_ROOT=`git rev-parse --show-toplevel`
|
||||
source `dirname "$0"`/common.sh
|
||||
|
||||
export CARGO_INCREMENTAL=0
|
||||
|
||||
# Save current directory.
|
||||
pushd .
|
||||
|
||||
cd $ROOT
|
||||
|
||||
for SRC in "${SRCS[@]}"
|
||||
do
|
||||
echo "*** Building wasm binaries in $SRC"
|
||||
cd "$PROJECT_ROOT/$SRC"
|
||||
|
||||
./build.sh
|
||||
|
||||
cd - >> /dev/null
|
||||
done
|
||||
|
||||
# Restore initial directory.
|
||||
popd
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ROOT=`dirname "$0"`
|
||||
|
||||
# A list of directories which contain wasm projects.
|
||||
SRCS=(
|
||||
"polkadot/runtime/wasm"
|
||||
"substrate/executor/wasm"
|
||||
)
|
||||
|
||||
DEMOS=(
|
||||
"demo/runtime/wasm"
|
||||
"substrate/test-runtime/wasm"
|
||||
"polkadot/test-parachains/"
|
||||
)
|
||||
|
||||
# Make pushd/popd silent.
|
||||
|
||||
pushd () {
|
||||
command pushd "$@" > /dev/null
|
||||
}
|
||||
|
||||
popd () {
|
||||
command popd "$@" > /dev/null
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "*** Initialising WASM build environment"
|
||||
|
||||
rustup update nightly
|
||||
rustup target add wasm32-unknown-unknown --toolchain nightly
|
||||
rustup update stable
|
||||
|
||||
# Install wasm-gc. It's useful for stripping slimming down wasm binaries.
|
||||
command -v wasm-gc || \
|
||||
cargo +nightly install --git https://github.com/alexcrichton/wasm-gc
|
||||
Reference in New Issue
Block a user