-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use in-container storage instead of mounted storage
To improving container disk performance for the `npx create-react-app` command, as pointed out at #2
- Loading branch information
Showing
3 changed files
with
61 additions
and
10 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
BOYAKI_DIRECTORY=/workspaces/boyaki | ||
ARCHIVE_NAME=boyaki.zip | ||
TARGET=${MOUNTED_HOST_DIR_PATH_IN_CONTAINER}/boyaki | ||
|
||
|
||
if [ -f "${TARGET}/${ARCHIVE_NAME}" ]; then | ||
echo "We can't override the existing \"${MOUNTED_HOST_DIR}/boyaki/${ARCHIVE_NAME}\" file on your host machine!" 1>&2 | ||
echo "Remove the file first and re-run again :)" 1>&2 | ||
exit 2 | ||
fi | ||
|
||
echo "Creating an arhive file from \"${BOYAKI_DIRECTORY}\" inside container..." | ||
cd ${BOYAKI_DIRECTORY}/ | ||
ZIP_FILE="/tmp/${ARCHIVE_NAME}" | ||
rm -f ${ZIP_FILE} && zip -qr ${ZIP_FILE} ./ | ||
|
||
echo "Copying the archive file to \"${MOUNTED_HOST_DIR}/boyaki/${ARCHIVE_NAME}\"..." | ||
mkdir -p ${TARGET} | ||
cp ${ZIP_FILE} ${TARGET}/${ARCHIVE_NAME} | ||
|
||
echo "Done! Yay!" |