Skip to content

Commit

Permalink
Update Docker image version and registry tagging logic
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cniweb committed Jan 14, 2025
1 parent bbaef27 commit 08322c2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM debian:stable-slim

ARG VERSION_TAG=2.5.3
ENV ALGO="randomx"
ENV POOL_ADDRESS="stratum+ssl://rx.unmineable.com:443"
ENV WALLET_USER="LNec6RpZxX6Q1EJYkKjUPBTohM7Ux6uMUy"
Expand All @@ -10,10 +11,11 @@ RUN apt-get -y update \
&& apt-get -y upgrade \
&& apt-get -y install curl wget \
&& cd /opt \
&& 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 \
&& VERSION_STRING=$(echo "$VERSION_TAG" | tr '.' '-') \
&& curl -L https://github.com/doktor83/SRBMiner-Multi/releases/download/${VERSION_TAG}/SRBMiner-Multi-${VERSION_STRING}-Linux.tar.gz -o SRBMiner-Multi.tar.gz \
&& tar xf SRBMiner-Multi.tar.gz \
&& rm -rf SRBMiner-Multi.tar.gz \
&& mv /opt/SRBMiner-Multi-2-5-3/ /opt/SRBMiner-Multi/ \
&& mv /opt/SRBMiner-Multi-${VERSION_STRING}/ /opt/SRBMiner-Multi/ \
&& apt-get -y autoremove --purge \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
Expand Down
38 changes: 25 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
#!/bin/bash
version="2.5.3"
# Define image name, version and registries
image="srbminer-multi"
docker build . --tag docker.io/cniweb/$image:$version
docker tag docker.io/cniweb/$image:$version docker.io/cniweb/$image:latest
docker tag docker.io/cniweb/$image:$version ghcr.io/cniweb/$image:$version
docker tag docker.io/cniweb/$image:$version ghcr.io/cniweb/$image:latest
docker tag docker.io/cniweb/$image:$version quay.io/cniweb/$image:$version
docker tag docker.io/cniweb/$image:$version quay.io/cniweb/$image:latest
docker push docker.io/cniweb/$image:$version
docker push docker.io/cniweb/$image:latest
docker push ghcr.io/cniweb/$image:$version
docker push ghcr.io/cniweb/$image:latest
docker push quay.io/cniweb/$image:$version
docker push quay.io/cniweb/$image:latest
version="2.6.9"
registries=("docker.io" "ghcr.io" "quay.io")

# Build the image
docker build . --build-arg VERSION_TAG=$version --tag ${registries[0]}/cniweb/$image:$version

# Check if the command was successful
if [ $? -ne 0 ]; then
echo "Docker build failed!"
exit 1
fi

echo "Docker build succeeded!"

# Tag and push the images
for registry in "${registries[@]}"; do
docker tag ${registries[0]}/cniweb/$image:$version $registry/cniweb/$image:$version
docker tag ${registries[0]}/cniweb/$image:$version $registry/cniweb/$image:latest

# Push both versioned and latest tags
docker push $registry/cniweb/$image:$version
docker push $registry/cniweb/$image:latest
done

0 comments on commit 08322c2

Please sign in to comment.