Made docker's build-kit optional.

This commit is contained in:
2025-03-30 16:14:11 +03:00
parent 4756c0f38a
commit 3635d739a5
2 changed files with 16 additions and 2 deletions

View File

@@ -24,7 +24,12 @@ Adds an abstraction layer on top of your Database.
Needed to download and build the docker container.
```bash
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install wget git docker.io docker-buildx -y
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install wget git docker.io -y
```
[Optional] Install Docker build-kit:
```bash
sudo apt-get docker-buildx -y
```

View File

@@ -49,7 +49,16 @@ build_docker_image() {
return 1
fi
echo "Building Docker image..."
export DOCKER_BUILDKIT=1
# Check if BuildKit is installed
if docker buildx version &>/dev/null; then
echo "BuildKit detected. Enabling BuildKit..."
export DOCKER_BUILDKIT=1
else
echo "BuildKit not found. Using legacy builder..."
export DOCKER_BUILDKIT=0
fi
if docker build -t "$IMAGE_NAME" .; then
echo "Docker image built successfully."
return 0