feat: add base image build/push commands to Makefile
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
New commands: • make docker-build-base - Build base image locally • make docker-push-base - Push base to Harbor • make docker-build - Build app (updated to use base) • make docker-push - Push app to Harbor Usage: 1. make docker-login 2. make docker-build-base 3. make docker-push-base 4. make docker-build 5. make docker-push
This commit is contained in:
38
Makefile
38
Makefile
@@ -76,24 +76,50 @@ clean:
|
||||
rm -rf dist/
|
||||
|
||||
# Docker commands
|
||||
docker-build-base:
|
||||
@echo "Building base image..."
|
||||
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker buildx build \
|
||||
-f docker/Dockerfile.base \
|
||||
-t hub.peikarband.ir/peikarband/base:latest \
|
||||
-t hub.peikarband.ir/peikarband/base:python3.11-node20 \
|
||||
--build-arg PYTHON_VERSION=3.11 \
|
||||
--build-arg NODE_VERSION=20 \
|
||||
--platform linux/amd64 \
|
||||
--load \
|
||||
.
|
||||
@echo "✅ Base image built successfully!"
|
||||
|
||||
docker-push-base:
|
||||
@echo "Pushing base image to Harbor..."
|
||||
docker push hub.peikarband.ir/peikarband/base:latest
|
||||
docker push hub.peikarband.ir/peikarband/base:python3.11-node20
|
||||
@echo "✅ Base image pushed successfully!"
|
||||
|
||||
docker-build:
|
||||
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker build \
|
||||
@echo "Building application image..."
|
||||
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker buildx build \
|
||||
-f docker/Dockerfile \
|
||||
-t $(IMAGE_NAME):$(VERSION) \
|
||||
-t $(IMAGE_NAME):latest \
|
||||
-t hub.peikarband.ir/$(IMAGE_NAME):$(VERSION) \
|
||||
-t hub.peikarband.ir/$(IMAGE_NAME):latest \
|
||||
--build-arg BASE_IMAGE=hub.peikarband.ir/peikarband/base:latest \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
--build-arg BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||
--platform linux/amd64 \
|
||||
--load \
|
||||
.
|
||||
@echo "✅ Application image built successfully!"
|
||||
|
||||
docker-push:
|
||||
docker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)/$(IMAGE_NAME):$(VERSION)
|
||||
docker tag $(IMAGE_NAME):$(VERSION) $(REGISTRY)/$(IMAGE_NAME):latest
|
||||
docker push $(REGISTRY)/$(IMAGE_NAME):$(VERSION)
|
||||
docker push $(REGISTRY)/$(IMAGE_NAME):latest
|
||||
@echo "Pushing application image to Harbor..."
|
||||
docker push hub.peikarband.ir/$(IMAGE_NAME):$(VERSION)
|
||||
docker push hub.peikarband.ir/$(IMAGE_NAME):latest
|
||||
@echo "✅ Application image pushed successfully!"
|
||||
|
||||
docker-login:
|
||||
@echo "Logging in to Harbor registry..."
|
||||
@docker login $(REGISTRY)
|
||||
@docker login hub.peikarband.ir
|
||||
|
||||
docker-up:
|
||||
docker-compose -f docker/docker-compose.yml up -d
|
||||
|
||||
Reference in New Issue
Block a user