chore: Add local-testing Dockerfile and build script for feature branch testing in docker#674
Open
Steve-Mcl wants to merge 4 commits into
Open
chore: Add local-testing Dockerfile and build script for feature branch testing in docker#674Steve-Mcl wants to merge 4 commits into
Steve-Mcl wants to merge 4 commits into
Conversation
Contributor
Author
|
FWIW, this was developed and tested on Ubuntu (on WSL) Likely worth a pull + test on other distro |
hardillb
approved these changes
Jun 26, 2026
hardillb
left a comment
Contributor
There was a problem hiding this comment.
Approved, but you need to make sure the packed tgz can't be checked in and is also in the .npmignore file to make sure it's never bundled in
Comment on lines
+28
to
+38
| # 1. Clear any old tarballs so only the fresh pack remains. | ||
| for f in flowfuse-device-agent-*.tgz; do | ||
| if [ -e "$f" ]; then | ||
| echo "Removing old pack: $f" | ||
| rm -f "$f" | ||
| fi | ||
| done | ||
|
|
||
| # 2. Package the local working copy. | ||
| echo "Running npm pack..." | ||
| npm pack |
Contributor
There was a problem hiding this comment.
You should add the tgz file to the .gitignore file so it can't be checked in
Contributor
Author
There was a problem hiding this comment.
Handled in commit ignore packs generated manually or by the docker local script
Contributor
Author
|
@hardillb i added ignores to npm and git - please check & approve again - ta. |
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.
Description
Foreword
During development work for #668 I needed to test changes in docker. I have long had a separate set of changes for doing this but thought it time to finalise them in a PR.
TLDR
Add a sh script that builds your current feature branch as a tagged image to simplify testing changes in docker.
Recorded instructions in
docker/build-local.md- we can move this (or point to it) in main README if desired?Details
This pull request introduces a new workflow for building and testing the
device-agentDocker image from local code changes, making it easier to validate feature branches before publishing. The main additions include a local-testing Dockerfile, a helper build script, and documentation explaining the process.Local development and testing support:
docker/build-local.md, a guide explaining how to use the new script and Dockerfile for local testing, including instructions for customizing image names and tags.docker/Dockerfile.local, a Dockerfile variant that installs the@flowfuse/device-agentpackage from a locally built tarball instead of npm, enabling local feature branch testing.docker/build-local.sh, a script that automates packaging the local code withnpm pack, cleans up old tarballs, and builds a Docker image tagged according to the current git branch.Related Issue(s)
none
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel