Commit f5ad62

2025-07-06 23:35:18 Tebby Dog: Placeholder
2-code/docker/docker-shortcuts.md ..
@@ 25,7 25,7 @@
This script automates the process of building and pushing a Docker image to DockerHub, while incrementally tracking the version number. It uses the directory name as the default local image name, but allows for customization through command-line arguments.
- The script builds the Docker image with a version tag in the format `MM.DD.YY.<counter>`, where `<counter>` is an incremental value stored in a file. The image is then tagged with additional tags on DockerHub (`latest` and `tebwritescode/<image_name>:<date>.<counter>`).
+ The script builds the Docker image with a version tag in the format `MM.DD.YY.<counter>`, where `<counter>` is an incremental value stored in a file. The image is then tagged with additional tags on DockerHub (`latest` and `<dockerhub_repo>/<image_name>:<date>.<counter>`).
# Usage**
@@ 51,10 51,10 @@
When you run the script, it will output something like this:
```
Docker image built with tag: myimage:02.14.21.1
- Docker image tagged: tebwritescode/myimage:02.14.21.1
- Docker image tagged: tebwritescode/myimage:latest
- Docker image pushed: tebwritescode/myimage:02.14.21.1
- Docker image pushed: tebwritescode/myimage:latest
+ Docker image tagged: <dockerhub_repo>/myimage:02.14.21.1
+ Docker image tagged: <dockerhub_repo>/myimage:latest
+ Docker image pushed: <dockerhub_repo>/myimage:02.14.21.1
+ Docker image pushed: <dockerhub_repo>/myimage:latest
Local Image Name: myimage
Docker Image Name: myimage
@@ 79,7 79,7 @@
curl -sSO https://github.com/tebwritescode/dcp/blob/14d5d8d8126f94e9867152339f1ee644ee9e1c1e/dcp.sh > /opt/dcp/dcp.sh && chmod +x /opt/dcp/dcp.sh
```
- Or copy-pasta
+ Or copy-pasta, make sure to replace the <dockerhub_repo> instances with your own fuckin' repo
```bash
#!/bin/bash
@@ 136,20 136,20 @@
echo "Docker image built with tag: $IMAGE_NAME:$DATE.$NEW_COUNTER"
# Tag the image for DockerHub
- /usr/bin/docker tag "$IMAGE_NAME:$DATE.$NEW_COUNTER" tebwritescode/"$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
- /usr/bin/docker tag "$IMAGE_NAME:$DATE.$NEW_COUNTER" tebwritescode/"$DOCKER_IMAGE_NAME:latest"
+ /usr/bin/docker tag "$IMAGE_NAME:$DATE.$NEW_COUNTER" <dockerhub_repo>/"$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
+ /usr/bin/docker tag "$IMAGE_NAME:$DATE.$NEW_COUNTER" <dockerhub_repo>/"$DOCKER_IMAGE_NAME:latest"
# Print the image tag for reference
- echo "Docker image tagged: tebwritescode/$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
- echo "Docker image tagged: tebwritescode/$DOCKER_IMAGE_NAME:latest"
+ echo "Docker image tagged: <dockerhub_repo>/$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
+ echo "Docker image tagged: <dockerhub_repo>/$DOCKER_IMAGE_NAME:latest"
# Push the Docker image to DockerHub
- if ! /usr/bin/docker push tebwritescode/"$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"; then
+ if ! /usr/bin/docker push <dockerhub_repo>/"$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"; then
echo "Docker push failed for $NEW_COUNTER."
exit 1
fi
- if ! /usr/bin/docker push tebwritescode/"$DOCKER_IMAGE_NAME:latest"; then
+ if ! /usr/bin/docker push <dockerhub_repo>/"$DOCKER_IMAGE_NAME:latest"; then
echo "Docker push failed for 'latest'."
exit 1
fi
@@ 159,8 159,8 @@
echo "Docker Image Name: $DOCKER_IMAGE_NAME"
# Print the image push for reference
- echo "Docker image pushed: tebwritescode/$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
- echo "Docker image pushed: tebwritescode/$DOCKER_IMAGE_NAME:latest"
+ echo "Docker image pushed: <dockerhub_repo>/$DOCKER_IMAGE_NAME:$DATE.$NEW_COUNTER"
+ echo "Docker image pushed: <dockerhub_repo>/$DOCKER_IMAGE_NAME:latest"
```
# Setting up an Alias
@@ 181,4 181,4 @@
```bash
dcp myimage latest
```
- This will build and push a Docker image with the tag `tebwritescode/myimage:latest`.
+ This will build and push a Docker image with the tag `<dockerhub_repo>/myimage:latest`.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9