mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-13 21:31:18 +02:00
Provide multi-platform docker builds. Closes #119.
This commit is contained in:
@@ -117,6 +117,8 @@ Alternatively, if you have already cloned the repo, you can fetch just the prebu
|
|||||||
|
|
||||||
> **Warning:** Docker has had reports intermittent issues with serial event subscriptions. The native method above is more reliable.
|
> **Warning:** Docker has had reports intermittent issues with serial event subscriptions. The native method above is more reliable.
|
||||||
|
|
||||||
|
Local Docker builds are architecture-native by default. On Apple Silicon Macs and ARM64 Linux hosts such as Raspberry Pi, `docker compose build` / `docker compose up --build` will produce an ARM64 image unless you override the platform.
|
||||||
|
|
||||||
Edit `docker-compose.yaml` to set a serial device for passthrough, or uncomment your transport (serial or TCP). Then:
|
Edit `docker-compose.yaml` to set a serial device for passthrough, or uncomment your transport (serial or TCP). Then:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -148,6 +150,15 @@ docker compose pull
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Published Docker tags are intended to be multi-arch (`linux/amd64` and `linux/arm64`). If you are building and publishing manually, use Docker Buildx:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
-t jkingsman/remoteterm-meshcore:latest \
|
||||||
|
--push .
|
||||||
|
```
|
||||||
|
|
||||||
The container runs as root by default for maximum serial passthrough compatibility across host setups. On Linux, if you switch between native and Docker runs, `./data` can end up root-owned. If you do not need that serial compatibility behavior, you can enable the optional `user: "${UID:-1000}:${GID:-1000}"` line in `docker-compose.yaml` to keep ownership aligned with your host user.
|
The container runs as root by default for maximum serial passthrough compatibility across host setups. On Linux, if you switch between native and Docker runs, `./data` can end up root-owned. If you do not need that serial compatibility behavior, you can enable the optional `user: "${UID:-1000}:${GID:-1000}"` line in `docker-compose.yaml` to keep ownership aligned with your host user.
|
||||||
|
|
||||||
To stop:
|
To stop:
|
||||||
|
|||||||
+42
-18
@@ -12,6 +12,8 @@ cd "$SCRIPT_DIR"
|
|||||||
|
|
||||||
RELEASE_WORK_DIR=""
|
RELEASE_WORK_DIR=""
|
||||||
RELEASE_BUNDLE_DIR_NAME="Remote-Terminal-for-MeshCore"
|
RELEASE_BUNDLE_DIR_NAME="Remote-Terminal-for-MeshCore"
|
||||||
|
DOCKER_IMAGE="jkingsman/remoteterm-meshcore"
|
||||||
|
DOCKER_PLATFORMS="linux/amd64,linux/arm64"
|
||||||
|
|
||||||
cleanup_release_build_artifacts() {
|
cleanup_release_build_artifacts() {
|
||||||
if [ -d "$SCRIPT_DIR/frontend/prebuilt" ]; then
|
if [ -d "$SCRIPT_DIR/frontend/prebuilt" ]; then
|
||||||
@@ -24,6 +26,28 @@ cleanup_release_build_artifacts() {
|
|||||||
|
|
||||||
trap cleanup_release_build_artifacts EXIT
|
trap cleanup_release_build_artifacts EXIT
|
||||||
|
|
||||||
|
ensure_buildx_builder() {
|
||||||
|
if ! docker buildx version >/dev/null 2>&1; then
|
||||||
|
echo -e "${RED}Error: docker buildx is required for multi-arch Docker builds.${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local current_builder
|
||||||
|
current_builder="$(docker buildx inspect --format '{{ .Name }}' 2>/dev/null || true)"
|
||||||
|
|
||||||
|
if [ -n "$current_builder" ]; then
|
||||||
|
docker buildx inspect --bootstrap >/dev/null
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if docker buildx inspect remoteterm-multiarch >/dev/null 2>&1; then
|
||||||
|
docker buildx use remoteterm-multiarch >/dev/null
|
||||||
|
else
|
||||||
|
docker buildx create --name remoteterm-multiarch --use >/dev/null
|
||||||
|
fi
|
||||||
|
docker buildx inspect --bootstrap >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
echo -e "${YELLOW}=== RemoteTerm for MeshCore Publish Script ===${NC}"
|
echo -e "${YELLOW}=== RemoteTerm for MeshCore Publish Script ===${NC}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@@ -199,21 +223,18 @@ rm -f "$SCRIPT_DIR/$RELEASE_ASSET"
|
|||||||
echo -e "${GREEN}Packaged release artifact created: $RELEASE_ASSET${NC}"
|
echo -e "${GREEN}Packaged release artifact created: $RELEASE_ASSET${NC}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Build docker image
|
# Build and push multi-arch docker image
|
||||||
echo -e "${YELLOW}Building Docker image...${NC}"
|
echo -e "${YELLOW}Building and pushing multi-arch Docker image...${NC}"
|
||||||
docker build --build-arg COMMIT_HASH=$GIT_HASH \
|
ensure_buildx_builder
|
||||||
-t jkingsman/remoteterm-meshcore:latest \
|
docker buildx build \
|
||||||
-t jkingsman/remoteterm-meshcore:$VERSION \
|
--platform "$DOCKER_PLATFORMS" \
|
||||||
-t jkingsman/remoteterm-meshcore:$GIT_HASH .
|
--build-arg COMMIT_HASH="$GIT_HASH" \
|
||||||
echo -e "${GREEN}Docker build complete!${NC}"
|
-t "$DOCKER_IMAGE:latest" \
|
||||||
echo
|
-t "$DOCKER_IMAGE:$VERSION" \
|
||||||
|
-t "$DOCKER_IMAGE:$GIT_HASH" \
|
||||||
# Push docker images
|
--push \
|
||||||
echo -e "${YELLOW}Pushing Docker images...${NC}"
|
.
|
||||||
docker push jkingsman/remoteterm-meshcore:latest
|
echo -e "${GREEN}Multi-arch Docker build + push complete!${NC}"
|
||||||
docker push jkingsman/remoteterm-meshcore:$VERSION
|
|
||||||
docker push jkingsman/remoteterm-meshcore:$GIT_HASH
|
|
||||||
echo -e "${GREEN}Docker push complete!${NC}"
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Create GitHub release using the changelog notes for this version.
|
# Create GitHub release using the changelog notes for this version.
|
||||||
@@ -254,9 +275,12 @@ echo -e "${GREEN}=== Publish complete! ===${NC}"
|
|||||||
echo -e "Version: ${YELLOW}$VERSION${NC}"
|
echo -e "Version: ${YELLOW}$VERSION${NC}"
|
||||||
echo -e "Git hash: ${YELLOW}$GIT_HASH${NC}"
|
echo -e "Git hash: ${YELLOW}$GIT_HASH${NC}"
|
||||||
echo -e "Docker tags pushed:"
|
echo -e "Docker tags pushed:"
|
||||||
echo -e " - jkingsman/remoteterm-meshcore:latest"
|
echo -e " - $DOCKER_IMAGE:latest"
|
||||||
echo -e " - jkingsman/remoteterm-meshcore:$VERSION"
|
echo -e " - $DOCKER_IMAGE:$VERSION"
|
||||||
echo -e " - jkingsman/remoteterm-meshcore:$GIT_HASH"
|
echo -e " - $DOCKER_IMAGE:$GIT_HASH"
|
||||||
|
echo -e "Platforms:"
|
||||||
|
echo -e " - linux/amd64"
|
||||||
|
echo -e " - linux/arm64"
|
||||||
echo -e "GitHub release:"
|
echo -e "GitHub release:"
|
||||||
echo -e " - $VERSION"
|
echo -e " - $VERSION"
|
||||||
echo -e "Release artifact:"
|
echo -e "Release artifact:"
|
||||||
|
|||||||
Reference in New Issue
Block a user