Skip to content

Commit 08322c2

Browse files
committed
Update Docker image version and registry tagging logic
Update the Dockerfile to use a dynamic version tag for SRBMiner-Multi Revise the build script to support specifying the version and multiple registries Improve tagging and pushing logic for Docker images across different repositories
1 parent bbaef27 commit 08322c2

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM debian:stable-slim
22

3+
ARG VERSION_TAG=2.5.3
34
ENV ALGO="randomx"
45
ENV POOL_ADDRESS="stratum+ssl://rx.unmineable.com:443"
56
ENV WALLET_USER="LNec6RpZxX6Q1EJYkKjUPBTohM7Ux6uMUy"
@@ -10,10 +11,11 @@ RUN apt-get -y update \
1011
&& apt-get -y upgrade \
1112
&& apt-get -y install curl wget \
1213
&& cd /opt \
13-
&& curl -L https://github.com/doktor83/SRBMiner-Multi/releases/download/2.5.3/SRBMiner-Multi-2-5-3-Linux.tar.gz -o SRBMiner-Multi.tar.gz \
14+
&& VERSION_STRING=$(echo "$VERSION_TAG" | tr '.' '-') \
15+
&& curl -L https://github.com/doktor83/SRBMiner-Multi/releases/download/${VERSION_TAG}/SRBMiner-Multi-${VERSION_STRING}-Linux.tar.gz -o SRBMiner-Multi.tar.gz \
1416
&& tar xf SRBMiner-Multi.tar.gz \
1517
&& rm -rf SRBMiner-Multi.tar.gz \
16-
&& mv /opt/SRBMiner-Multi-2-5-3/ /opt/SRBMiner-Multi/ \
18+
&& mv /opt/SRBMiner-Multi-${VERSION_STRING}/ /opt/SRBMiner-Multi/ \
1719
&& apt-get -y autoremove --purge \
1820
&& apt-get -y clean \
1921
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

build.sh

+25-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
#!/bin/bash
2-
version="2.5.3"
2+
# Define image name, version and registries
33
image="srbminer-multi"
4-
docker build . --tag docker.io/cniweb/$image:$version
5-
docker tag docker.io/cniweb/$image:$version docker.io/cniweb/$image:latest
6-
docker tag docker.io/cniweb/$image:$version ghcr.io/cniweb/$image:$version
7-
docker tag docker.io/cniweb/$image:$version ghcr.io/cniweb/$image:latest
8-
docker tag docker.io/cniweb/$image:$version quay.io/cniweb/$image:$version
9-
docker tag docker.io/cniweb/$image:$version quay.io/cniweb/$image:latest
10-
docker push docker.io/cniweb/$image:$version
11-
docker push docker.io/cniweb/$image:latest
12-
docker push ghcr.io/cniweb/$image:$version
13-
docker push ghcr.io/cniweb/$image:latest
14-
docker push quay.io/cniweb/$image:$version
15-
docker push quay.io/cniweb/$image:latest
4+
version="2.6.9"
5+
registries=("docker.io" "ghcr.io" "quay.io")
6+
7+
# Build the image
8+
docker build . --build-arg VERSION_TAG=$version --tag ${registries[0]}/cniweb/$image:$version
9+
10+
# Check if the command was successful
11+
if [ $? -ne 0 ]; then
12+
echo "Docker build failed!"
13+
exit 1
14+
fi
15+
16+
echo "Docker build succeeded!"
17+
18+
# Tag and push the images
19+
for registry in "${registries[@]}"; do
20+
docker tag ${registries[0]}/cniweb/$image:$version $registry/cniweb/$image:$version
21+
docker tag ${registries[0]}/cniweb/$image:$version $registry/cniweb/$image:latest
22+
23+
# Push both versioned and latest tags
24+
docker push $registry/cniweb/$image:$version
25+
docker push $registry/cniweb/$image:latest
26+
done
27+

0 commit comments

Comments
 (0)