-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor run-nodered script #816
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c6e6508
Refactor run-nodered script
andistorm d3a67c0
Add comments to the nodered script
andistorm 439cfa1
Use debian:12-slim as temporarily container image
andistorm d18da86
Merge branch 'main' into refactor/run-nodered-script
andistorm 796e0e1
update tag
andistorm ed71995
Add prefix
andistorm d7ddd8d
Merge branch 'main' into refactor/run-nodered-script
andistorm 14ca168
set group and owner of docker volume
andistorm 3de153e
Merge branch 'main' into refactor/run-nodered-script
andistorm e82d5ad
Merge branch 'main' into refactor/run-nodered-script
Pietfried File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
cd @EVEREST_DOCKER_DIR@ | ||
docker build -t everest-nodered . | ||
docker run --rm --network host --name everest_nodered --mount type=bind,source=@FLOW_FILE@,target=/data/flows.json everest-nodered | ||
# In the following a volume is created to contain the nodered config, this is done to | ||
# allow starting the nodered container from inside a devcontainer | ||
|
||
# Create docker volume to contain nodered config | ||
docker volume create everest-nodered-config-volume | ||
|
||
# Create temporarily container to copy nodered config into the created volume | ||
docker run --name everest-nodered-config-container -v everest-nodered-config-volume:/data debian:12-slim chown -R 1000:1000 /data | ||
|
||
# Copy nodered config to the created volume with the temporarily created container | ||
docker cp @FLOW_FILE@ everest-nodered-config-container:/data/flows.json | ||
|
||
# Remove temporarily container | ||
docker rm everest-nodered-config-container | ||
|
||
# Start nodered container with the volume mounted to /data | ||
docker run --rm --network host --name everest_nodered --mount type=volume,source=everest-nodered-config-volume,target=/data ghcr.io/everest/everest-dev-environment/nodered:docker-images-v0.1.0 |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does using a volume allow to start the node-red container from inside a dev container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workspace inside the devcontainer is mounted to an other path. So you would need to know about the host path of the flow file.
docker run
is executed on host with host pathsdocker cp
is executed with container's pathsThis way it is possible to copy a file with only knowing the devcontainer paths into a docker volume which then can be mounted by name into the nodered container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, well this is really ugly. These docker inside docker scenarios are quite special, not sure whether we should support these - they might break quite easily. This script here basically only works, if the devcontainer has been launched correctly - which is an assumption I wouldn't necessarily make.
Does this script work, when executed from the host (i.e. outside of the container?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not real docker inside docker, because it is more like remote controlling the hosts docker socket.
This script is designed to work inside and outside the devcontainer. Of course it needs to be rebuild when changed because of paths