Skip to content
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

Added GpioD dependencies #3

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 4 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,24 @@ docker images used for compiling/building the Pi4J projects. The Pi4J builder i
include the following:

- **[Pi4J Base Builder](https://hub.docker.com/repository/docker/pi4j/pi4j-builder-base)** `pi4j/pi4j-builder-base:latest` :
This is the base image used by all the other builder images. It's based on Ubuntu 18.04
with JDK 11 and Maven pre-installed. This image's entry point is a Bash shell.
This is the base image used by all the other builder images. It's based on Ubuntu 22.04
with JDK 21 and Maven pre-installed. This image's entry point is a Bash shell.
(https://hub.docker.com/repository/docker/pi4j/pi4j-builder-base)

- **[Pi4J Native Builder](https://hub.docker.com/repository/docker/pi4j/pi4j-builder-native)** `pi4j/pi4j-builder-native:latest` :
This image is derived from `pi4j/pi4j-builder-base` and adds support for native cross-compilers
and build tools for architectures: `arm`, `armhf`, `aarch64/arm64`. This image's
entry point is a bash shell attempting to execute the file `./build.sh` in the volume mounted
under the `/build` path.

- **[Pi4J v1.4 Builder](https://hub.docker.com/repository/docker/pi4j/pi4j-builder:1.4)** `pi4j/pi4j-builder:1.4` :
This image is derived from `pi4j/pi4j-builder-native` and additionally includes pre-cached Maven
build plugins and dependencies for [Pi4J v1.4](http://github.com/Pi4J/pi4j) builds. This image's
entry point is a Maven shell. If not explicitly provided, the default maven build arguments will be:
`clean install -DskipTests -Pnative,cross-compile`. This will effectively build all Pi4J projects including
the `pi4j-native` project containing native libraries which will be cross-compiled for RaspberryPi/ARM
(32-bit & 64-bit) devices.


- **[Pi4J v2.0 Builder](https://hub.docker.com/repository/docker/pi4j/pi4j-builder:2.0)** `pi4j/pi4j-builder:2.0` :
This image is derived from `pi4j/pi4j-builder-native` and additionally includes pre-cached Maven
build plugins and dependencies for [Pi4J v2.0](http://github.com/Pi4J/pi4j-v2) builds. This image's
entry point is a Maven shell. If not explicitly provided, the default maven build arguments will be:
`clean install -DskipTests -Pnative,cross-compile`. This will effectively build all Pi4J projects including
the native library projects which will be cross-compiled for RaspberryPi/ARM (32-bit & 64-bit) devices.

**Note:** Pi4J versions prior to v1.4 are not currently tested or supported in these Docker images.
**Note:** Pi4J versions prior to v2.0 are not supported in these Docker images.

---
### Prerequisites:
Expand Down Expand Up @@ -64,25 +56,6 @@ include the following:
---
### How to Build the Pi4J Project using these Docker Images:

#### Build Pi4J v1.4

Navigate to the parent "pi4j" directory and execute the following Docker commands:
```
docker pull pi4j/pi4j-builder:1.4
docker run \\
--user "$(id -u):$(id -g)" \
--rm \
--volume $(pwd):/build \
pi4j/pi4j-builder:1.4
```
| Docker Command Argument | Description |
| ------------- | ------------- |
| `run` | launch the Pi4J Builder container |
| `--user` | Run the build container with your user id/group id. (_this is not needed for Window or MacOS_) |
| `--rm` | Remove the temporary build container upon completion |
| `--volume` | Mount the current directory to the Docker container's `/build` path. This is where the container will attempt to locate and execute the `./build.sh` script. |
| `pi4j/pi4j-builder:1.4` | The Pi4J build container image name and version. |

#### Build Pi4J v2.0

Navigate to the parent "pi4j" directory and execute the following Docker commands:
Expand Down Expand Up @@ -118,9 +91,6 @@ The Pi4J Docker Builder images are built using the following shell scripts:
| `./pi4j-builder-native/build.sh` | builds the Pi4J Native Builder image locally for: `x86_64/amd64` & `aarch64/arm64` architectures. |
| `./pi4j-builder-native/build.sh --push` | builds the Pi4J Native Builder image and pushes to DockerHub for: `x86_64/amd64` & `aarch64/arm64` architectures. |
| `./pi4j-builder-native/clean.sh` | cleans the build environment and removes images from the local system for the Pi4J Native Builder image. |
| `./pi4j-builder-1.4/build.sh` | builds the Pi4J Builder image for Pi4J v1.4 locally for: `x86_64/amd64` & `aarch64/arm64` architectures. |
| `./pi4j-builder-1.4/build.sh --push` | builds the Pi4J Builder image for Pi4J v1.4 and pushes to DockerHub for: `x86_64/amd64` & `aarch64/arm64` architectures.
| `./pi4j-builder-1.4/clean.sh` | cleans the build environment and removes images from the local system for the Pi4J Builder image for Pi4J v1.4. |
| `./pi4j-builder-2.0/build.sh` | builds the Pi4J Builder image for Pi4J v2.0 locally for: `x86_64/amd64` & `aarch64/arm64` architectures. |
| `./pi4j-builder-2.0/build.sh --push` | builds the Pi4J Builder image for Pi4J v2.0 and pushes to DockerHub for: `x86_64/amd64` & `aarch64/arm64` architectures. |
| `./pi4j-builder-2.0/clean.sh` | cleans the build environment and removes images from the local system for the Pi4J Builder image for Pi4J v2.0. |
19 changes: 10 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ echo "* *"
echo "**********************************************************************"
echo

#docker buildx rm --force pi4j-builder || true
#docker buildx create --use --bootstrap \
# --driver=docker-container \
# --name pi4j-builder

# **********************************************************************
# BUILDING Pi4J BASE BUILDER (DOCKER IMAGE)
# **********************************************************************
Expand All @@ -72,12 +77,6 @@ cd $BASE_DIR/pi4j-builder-base
cd $BASE_DIR/pi4j-builder-native
./build.sh $@

# **********************************************************************
# BUILDING Pi4J v1.4 BUILDER (DOCKER IMAGE)
# **********************************************************************
cd $BASE_DIR/pi4j-builder-1.4
./build.sh $@

# **********************************************************************
# BUILDING Pi4J v2.0 BUILDER (DOCKER IMAGE)
# **********************************************************************
Expand All @@ -87,13 +86,15 @@ cd $BASE_DIR/pi4j-builder-2.0
# **********************************************************************
# BUILDING Pi4J REPO BUILDER (DOCKER IMAGE)
# **********************************************************************
cd $BASE_DIR/pi4j-builder-repo
./build.sh $@
#cd $BASE_DIR/pi4j-builder-repo
#./build.sh $@

#docker buildx rm --force pi4j-builder

echo
echo "**********************************************************************"
echo "* *"
echo "* FINISHED BUILDING ALL Pi4J BUILDERS (DOCKER IMAGES) *"
echo "* *"
echo "**********************************************************************"
echo
echo
13 changes: 0 additions & 13 deletions pi4j-builder-1.4/.dockerignore

This file was deleted.

49 changes: 0 additions & 49 deletions pi4j-builder-1.4/Dockerfile

This file was deleted.

76 changes: 0 additions & 76 deletions pi4j-builder-1.4/build.sh

This file was deleted.

67 changes: 0 additions & 67 deletions pi4j-builder-1.4/clean.sh

This file was deleted.

4 changes: 2 additions & 2 deletions pi4j-builder-2.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---------------------------------------------------------------------------------
# NATIVE BUILDER IMAGE FOR Pi4J (cross-compilers for ARMHF & AARCH64)
# ---------------------------------------------------------------------------------
FROM pi4j/pi4j-builder-native:2.0
FROM pi4j/pi4j-builder-native:latest
ARG TARGETARCH
ARG BUILDDATE
ARG BUILDVERSION
Expand Down Expand Up @@ -32,7 +32,7 @@ RUN echo "========================================================="
# repository cache as part of the container image
RUN git clone --single-branch --branch main https://github.com/Pi4J/pi4j-v2 /pi4j
RUN cd /pi4j && \
mvn dependency:resolve dependency:resolve-plugins -DexcludeGroupIds="com.pi4j" -Pnative && \
mvn dependency:go-offline -DexcludeGroupIds=com.pi4j -Pnative && \
rm -R /pi4j

# ensure read/write access permissions to the M2 repository cache for all users
Expand Down
Loading
Loading