Conversation
… speedtest install
…, computed versioning, drop ::set-output
Owner
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s container build and release pipeline by switching to a slimmer Python base image, installing speedtest-cli via pip, and replacing the legacy Docker publish workflow with a workflow-dispatch driven, tag-producing build.
Changes:
- Update Docker image base to
python:3.12-slim, simplify system deps, and install Python deps via pip. - Add
speedtest-clitorequirements.txt(replacing the prior wget-based install approach). - Introduce a
next-version.shhelper and update the GitHub Actions workflow to compute versions, create git tags, and build/push multi-arch images.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Dockerfile |
Switches to Python slim image; simplifies runtime deps (keeps curl) and installs requirements via pip. |
requirements.txt |
Adds speedtest-cli as a pip dependency. |
scripts/next-version.sh |
New helper to compute YYYY.M.PATCH style versions from existing tags. |
.github/workflows/docker.yml |
Replaces legacy workflow with workflow_dispatch + version resolution, tag creation, and multi-arch build/push. |
.dockerignore |
Adds a dockerignore to reduce build context size. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+21
to
+30
| - name: Resolve version | ||
| id: version | ||
| run: | | ||
| if [ -n "${{ github.event.inputs.version }}" ]; then | ||
| VERSION="${{ github.event.inputs.version }}" | ||
| else | ||
| VERSION="$(./scripts/next-version.sh)" | ||
| fi | ||
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | ||
|
|
Comment on lines
+31
to
+37
| - name: Create and push tag | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git tag "${{ steps.version.outputs.version }}" | ||
| git push origin "${{ steps.version.outputs.version }}" | ||
|
|
Comment on lines
+3
to
+6
| TODAY="$(date +%Y.%-m)" | ||
| LATEST="$(git tag --list "${TODAY}.*" 2>/dev/null | sort -V | tail -1)" | ||
| if [ -z "$LATEST" ]; then echo "${TODAY}.0"; | ||
| else PATCH="${LATEST##*.}"; echo "${TODAY}.$((PATCH + 1))"; fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ubuntu:24.10topython:3.12-slimfor asmaller, purpose-built Python image
speedtest-clifrom a fragilewgetinstall to a standard pipdependency
maintainable one
Changes
Dockerfile
ubuntu:24.10topython:3.12-slim— Python ispre-installed, no manual
python3/pip3setup neededwgetstep that downloadedspeedtest.pyto a hardcodedpython3.12site-packages path (fragile and redundant)aptinstalls ofpython3,python3-pip,wget, andspeedtest-cli— now handled by pip or no longer neededcurl(required byip_commandat runtime)ENVdeclarations and addedPIP_NO_CACHE_DIR/PIP_DISABLE_PIP_VERSION_CHECKrequirements.txt
speedtest-cli— replaces the old wget-based install.dockerignore
.git, screenshots,dev scripts,
config/, etc.)scripts/next-version.sh
YYYY.M.PATCHdate-based version from gittags, used by the updated workflow
.github/workflows/docker.yml
checkout@v2→v4,setup-qemu@v1→v3,setup-buildx@v1→v3,login-action@v1→v3,build-push-action@v2→v5::set-outputwith>> "$GITHUB_OUTPUT"techblog/dockerbot-trainer→techblog/dockerbotrelease: publishedtrigger —workflow_dispatchonly, withan optional version input (auto-computed via
next-version.shif blank)contents: writepermission andfetch-depth: 0for tag creationTest plan
docker build .completes without error on a clean checkoutspeedtest-cliis available in the built image (docker run --rm techblog/dockerbot speedtest-cli --version)YYYY.M.PATCHand pushes a tagtechblog/dockerbot:latestandtechblog/dockerbot:<version>linux/amd64,linux/arm64,linux/arm/v7