-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: wanjunlei <[email protected]>
- Loading branch information
Showing
34 changed files
with
650 additions
and
479 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
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 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,26 @@ | ||
## Build builder of java | ||
|
||
Use the follow command to build a java builder. | ||
|
||
```shell | ||
hack/build.sh --with-stack --java-version < java_version > --docker-registry < registry > | ||
``` | ||
|
||
This command will create three image: | ||
|
||
```shell | ||
< REGISTRY >/buildpacks-java< java_version >-run:v1 | ||
< REGISTRY >/buildpacks-java< java_version >-build:v1 | ||
< REGISTRY >/builder-java:v2-< java_version > | ||
``` | ||
|
||
Parameters | ||
|
||
- `with-stack` - If specified, it will also build the build image and run image too. | ||
- `java-version` - The version of java, known value are 11, 16, 17, 18. | ||
- `docker-registry` - The docker registry where the image pushed to, default is `openfunction`. | ||
- `create-builder-only` - Only create the builder directory, and do not build image. The builder directory will be under `builders/java`. | ||
- `build-image` - The image used to build builder. | ||
- `run-image` - The image used to run the function. | ||
- `out-image` - The name of generated builder image. | ||
- `push-image` - If specified, it will push the image to the registry. |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,64 @@ | ||
description = "Ubuntu 18 base image with buildpacks for Nodejs" | ||
|
||
[[buildpacks]] | ||
id = "openfunction.java.functions-framework" | ||
uri = "java/functions_framework.tgz" | ||
|
||
[[buildpacks]] | ||
id = "openfunction.java.gradle" | ||
uri = "java/gradle.tgz" | ||
|
||
[[buildpacks]] | ||
id = "openfunction.java.maven" | ||
uri = "java/maven.tgz" | ||
|
||
[[buildpacks]] | ||
id = "google.java.clear_source" | ||
uri = "java/clear_source.tgz" | ||
|
||
[[buildpacks]] | ||
id = "google.utils.label" | ||
uri = "label.tgz" | ||
|
||
######## | ||
# Java # | ||
######## | ||
|
||
# Functions have separate groups because entrypoint not supported. | ||
[[order]] | ||
[[order.group]] | ||
id = "openfunction.java.maven" | ||
|
||
[[order.group]] | ||
id = "openfunction.java.functions-framework" | ||
|
||
[[order.group]] | ||
id = "google.java.clear_source" | ||
optional = true | ||
|
||
[[order.group]] | ||
id = "google.utils.label" | ||
|
||
[[order]] | ||
[[order.group]] | ||
id = "openfunction.java.gradle" | ||
optional = true | ||
|
||
[[order.group]] | ||
id = "openfunction.java.functions-framework" | ||
|
||
[[order.group]] | ||
id = "google.java.clear_source" | ||
optional = true | ||
|
||
[[order.group]] | ||
id = "google.utils.label" | ||
|
||
# Currently built with //builders/java/stack/stack:build. | ||
[stack] | ||
id = "openfunction.java< JAVA_VERSION >" | ||
build-image = "< REGISTRY >/buildpacks-java< JAVA_VERSION >-build:v1" | ||
run-image = "< REGISTRY >/buildpacks-java< JAVA_VERSION >-run:v1" | ||
|
||
[lifecycle] | ||
version = "0.13.2" |
File renamed without changes.
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,49 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG from_image | ||
FROM ${from_image} | ||
|
||
ARG cnb_uid=${CNB_USER_ID} | ||
ENV cnb_gid=${CNB_GROUP_ID} | ||
|
||
ARG maven_version=3.8.6 | ||
ARG gradle_version=7.4.2 | ||
|
||
COPY licenses/ /usr/local/share/licenses/buildpacks/ | ||
|
||
# unzip is required to extract gradle. | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
zip \ | ||
unzip \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ADD https://downloads.apache.org/maven/maven-3/${maven_version}/binaries/apache-maven-${maven_version}-bin.tar.gz / | ||
ADD https://services.gradle.org/distributions/gradle-${gradle_version}-bin.zip / | ||
|
||
RUN mkdir /usr/local/maven && \ | ||
tar xzf apache-maven-${maven_version}-bin.tar.gz -C /usr/local/maven && \ | ||
rm -rf apache-maven-${maven_version}-bin.tar.gz && \ | ||
ln -s /usr/local/maven/apache-maven-${maven_version} /usr/local/maven/current && \ | ||
chown -R ${cnb_uid}:${cnb_gid} /usr/local/maven && \ | ||
mkdir /usr/local/gradle && \ | ||
unzip -q gradle-${gradle_version}-bin.zip -d /usr/local/gradle && \ | ||
rm -rf gradle-${gradle_version}-bin.zip && \ | ||
ln -s /usr/local/gradle/gradle-${gradle_version} /usr/local/gradle/current && \ | ||
chown -R ${cnb_uid}:${cnb_gid} /usr/local/gradle | ||
|
||
ENV PATH=$PATH:/usr/local/maven/current/bin:/usr/local/gradle/current/bin | ||
|
||
USER cnb | ||
|
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 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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.