-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-and-push.sh
executable file
·38 lines (30 loc) · 1.01 KB
/
build-and-push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -e
set -x
# Define the base name for your images using GitHub Container Registry
base_image_name=ghcr.io/ecohealthalliance/slurm_reservoir
# Build and tag the base image
base_image=$base_image_name:base
echo "Building and tagging the base image..."
cd base
time docker build -f Dockerfile -t $base_image .
echo "Pushing the base image..."
docker push $base_image
cd ..
# Build and push the GPU image for the controller
controller_gpu_image=$base_image_name:controller-gpu
echo "Building the controller GPU image..."
cd controller
time docker build -f Dockerfile.gpu -t $controller_gpu_image .
echo "Pushing the controller GPU image..."
docker push $controller_gpu_image
cd ..
# Build and push the GPU image for the worker
worker_gpu_image=$base_image_name:worker-gpu
echo "Building the worker GPU image..."
cd Worker
time docker build -f Dockerfile.gpu -t $worker_gpu_image .
echo "Pushing the worker GPU image..."
docker push $worker_gpu_image
cd ..
echo "Docker images have been built and pushed successfully."