forked from lancaster-university/microbit-v2-samples
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker microbit-toolchain scripts
- Loading branch information
1 parent
8428ec2
commit 98fd539
Showing
2 changed files
with
37 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@echo off | ||
|
||
:: Check if Docker is installed | ||
where docker >nul 2>nul | ||
if %errorlevel% neq 0 ( | ||
echo Error: Docker is not installed. Please install Docker and try again. | ||
exit /b 1 | ||
) | ||
|
||
:: Check if the Docker image is already pulled | ||
set DockerImage=ghcr.io/carlosperate/microbit-toolchain:latest | ||
docker images %DockerImage% | findstr /i %DockerImage% >nul 2>nul | ||
if %errorlevel% neq 0 ( | ||
echo Pulling Docker image: %DockerImage% | ||
docker pull %DockerImage% | ||
) | ||
|
||
:: Run the Docker command | ||
docker run -v %CD%:/home --rm %DockerImage% %* |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Check if Docker is installed | ||
if ! command -v docker &> /dev/null; then | ||
echo "Error: Docker is not installed. Please install Docker and try again." | ||
exit 1 | ||
fi | ||
|
||
# Check if the Docker image is already pulled | ||
DOCKER_IMAGE="ghcr.io/carlosperate/microbit-toolchain:latest" | ||
|
||
if [[ "$(docker images -q $DOCKER_IMAGE 2> /dev/null)" == "" ]]; then | ||
echo "Pulling Docker image: $DOCKER_IMAGE" | ||
docker pull $DOCKER_IMAGE | ||
fi | ||
|
||
# Run the Docker command | ||
docker run -v ${PWD}:/home --rm $DOCKER_IMAGE "$@" |