This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
12 changed files
with
57 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
doc | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
pushd . | ||
|
||
# The following line ensure we run from the project root | ||
PROJECT_ROOT=`git rev-parse --show-toplevel` | ||
cd $PROJECT_ROOT | ||
|
||
# Find the current version from Cargo.toml | ||
VERSION=`grep "^version" ../Cargo.toml | egrep -o "([0-9\.]+)"` | ||
VERSION=`grep "^version" ./Cargo.toml | egrep -o "([0-9\.]+)"` | ||
GITUSER=chevdor | ||
GITREPO=polkadot | ||
|
||
# Build the image | ||
echo "Building ${GITREPO}:$VERSION docker image, hang on!" | ||
time docker build --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:$VERSION . | ||
echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!" | ||
time docker build -f ./docker/Dockerfile --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest . | ||
|
||
# Show the list of available images for this repo | ||
echo "Image is ready" | ||
docker images | grep ${GITREPO} | ||
|
||
echo -e "\nIf you just built the latest, you may want to update your tag:" | ||
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:latest" | ||
echo -e "\nIf you just built version ${VERSION}, you may want to update your tag:" | ||
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:${VERSION}" | ||
|
||
popd |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters