mirror of
https://github.com/logos-storage/codex-factory.git
synced 2026-01-02 13:03:07 +00:00
* feat: add cleanup script in favor of many build trials * feat: create docker images from specific state of spawned bee clients * chore: add generated Docker files to git * refactor: remove individual Docker files and create one common * feat: remove Dockerfile creation and simplify the script * feat: update common dockerfile on build * refactor: remove generated Dockerfile from git * chore: add generated Dockerfile to gitignore * chore: ignore Dockerfile * feat: check whether system environment variable is defined * feat: common variable handling, new bee.sh functionalities and params * feat: blockchain docker image build script * feat: environment script to start the created images * docs: amend readme * feat: add bee image prefix env variable and its handlings * feat: env variable handling + image prefix handling * docs: amend readme * feat: docker image prune * docs: amend readme * chore: echo for sudo password * chore: echo for sudo password * fix: environment queen logging * chore: remove commented out code * refactor: use osx compatible local variable init * refactor: use shell check extension and make the script osx compatible * fix: stop blockchain container as well on interrupting * fix: rule out commented lines from env checking * refactor: remove unnecessary echo * refactor: remove cat command from the .env grep * refactor: add some quotes to variable references where is necessary
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
dockerfile() {
|
|
cat << DOCKERFILE > "$1"
|
|
FROM ethersphere/bee:$2
|
|
|
|
# Sample docker file
|
|
COPY --chown=bee:bee . /home/bee/.bee
|
|
DOCKERFILE
|
|
}
|
|
|
|
dockerbuild() {
|
|
IMAGE_NAME=$(basename "$1")
|
|
IMAGE_NAME="$4/$IMAGE_NAME"
|
|
docker build "$1" --no-cache -f "$2" -t "$IMAGE_NAME:$3"
|
|
}
|
|
|
|
MY_PATH=$(dirname "$0")
|
|
MY_PATH=$( cd "$MY_PATH" && pwd )
|
|
BEE_DIRS=$(ls "$MY_PATH/bee-data-dirs")
|
|
BEE_VERSION=$("$MY_PATH/utils/env-variable-value.sh" BEE_VERSION)
|
|
BEE_IMAGE_PREFIX=$("$MY_PATH/utils/env-variable-value.sh" BEE_IMAGE_PREFIX)
|
|
|
|
# Make sure we the user has permission all the files
|
|
echo "Build Bee Docker images..."
|
|
echo "You may need to pass your password for sudo permission to give the right permission to the bee-data folders"
|
|
sudo chmod 777 -R "$MY_PATH/bee-data-dirs"
|
|
|
|
echo "Update common dockerfile"
|
|
dockerfile "$MY_PATH/bee-data-dirs/Dockerfile" "$BEE_VERSION"
|
|
|
|
echo "Build Dockerfiles"
|
|
for BEE_DIR in $BEE_DIRS
|
|
do
|
|
echo "$BEE_DIR"
|
|
dockerbuild "$MY_PATH/bee-data-dirs/$BEE_DIR" "$MY_PATH/bee-data-dirs/Dockerfile" "$BEE_VERSION" "$BEE_IMAGE_PREFIX"
|
|
done
|
|
|
|
echo "Docker image builds were successful!"
|