diff --git a/builders/gcp/base/BUILD.bazel b/builders/gcp/base/BUILD.bazel index 5f5aa3055..a3df215bc 100644 --- a/builders/gcp/base/BUILD.bazel +++ b/builders/gcp/base/BUILD.bazel @@ -160,52 +160,3 @@ builder( }, image = "google-22/builder", ) - -builder( - name = "min_22_builder", - buildpacks = [ - "//cmd/config/entrypoint:entrypoint.tgz", - "//cmd/utils/label:label_image.tgz", - ], - descriptor = "google.min.22.builder.toml", - groups = { - "dart": [ - "//cmd/dart/compile:compile.tgz", - "//cmd/dart/pub:pub.tgz", - "//cmd/dart/sdk:sdk.tgz", - ], - "dotnet": [ - "//cmd/dotnet/functions_framework:functions_framework.tgz", - "//cmd/dotnet/publish:publish.tgz", - "//cmd/dotnet/runtime:runtime.tgz", - "//cmd/dotnet/sdk:sdk.tgz", - ], - "go": [ - "//cmd/go/build:build.tgz", - "//cmd/go/clear_source:clear_source.tgz", - "//cmd/go/functions_framework:functions_framework.tgz", - "//cmd/go/gomod:gomod.tgz", - "//cmd/go/gopath:gopath.tgz", - "//cmd/go/runtime:runtime.tgz", - ], - "java": [ - "//cmd/java/clear_source:clear_source.tgz", - "//cmd/java/entrypoint:entrypoint.tgz", - "//cmd/java/exploded_jar:exploded_jar.tgz", - "//cmd/java/functions_framework:functions_framework.tgz", - "//cmd/java/gradle:gradle.tgz", - "//cmd/java/maven:maven.tgz", - "//cmd/java/runtime:runtime.tgz", - "//cmd/java/graalvm:graalvm.tgz", - "//cmd/java/native_image:native_image.tgz", - ], - "nodejs": [ - "//cmd/nodejs/functions_framework:functions_framework.tgz", - "//cmd/nodejs/npm:npm.tgz", - "//cmd/nodejs/runtime:runtime.tgz", - "//cmd/nodejs/yarn:yarn.tgz", - "//cmd/nodejs/pnpm:pnpm.tgz", - ], - }, - image = "google-min-22/builder", -) diff --git a/builders/gcp/base/google.min.22.builder.toml b/builders/gcp/base/google.min.22.builder.toml index 0b3baae35..46a316ece 100644 --- a/builders/gcp/base/google.min.22.builder.toml +++ b/builders/gcp/base/google.min.22.builder.toml @@ -485,7 +485,7 @@ description = "Ubuntu 18 base image with buildpacks for .NET, Go, Java, Node.js, [stack] id = "google.gae.22" - build-image = "gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/build" + build-image = "gcr.io/gae-runtimes/buildpacks/stacks/google-gae-22/build" run-image = "gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/run" [lifecycle] diff --git a/stacks/google_min_22/BUILD.bazel b/stacks/google_min_22/BUILD.bazel index 5fb6f4c9a..771e73da0 100644 --- a/stacks/google_min_22/BUILD.bazel +++ b/stacks/google_min_22/BUILD.bazel @@ -1,9 +1,6 @@ licenses(["notice"]) exports_files([ - "build-packages.txt", - "build.Dockerfile", - "build_structure_test.yaml", "run-packages.txt", "run.Dockerfile", "run_structure_test.yaml", diff --git a/stacks/google_min_22/README.md b/stacks/google_min_22/README.md index e87f5da7c..0470fdb71 100644 --- a/stacks/google_min_22/README.md +++ b/stacks/google_min_22/README.md @@ -15,27 +15,13 @@ Installed Packages: ## Build Image -[gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/build](https://gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/build) - -Installed Packages: - -* `build-essential` -* `ca-certificates` -* `curl` -* `git` -* `locales` -* `openssl` -* `tar` -* `tzdata` -* `unzip` -* `xz-utils` -* `zip` +[gcr.io/gae-runtimes/buildpacks/stacks/google-gae-22/build](https://gcr.io/gae-runtimes/buildpacks/stacks/google-gae-22/build) ## Building Images -Both the `run.Dockerfile` and `build.Dockerfile` image require `CANDIDATE_NAME` -as a `build-arg`. This is unique identifier used to track releases, but any -string can be provided for local development. +The `run.Dockerfile` image require `CANDIDATE_NAME` as a `build-arg`. This is +unique identifier used to track releases, but any string can be provided for +local development. To build the run image: @@ -46,15 +32,6 @@ DOCKER_BUILDKIT=1 docker build . \ --tag gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/run ``` -To build the build image: - -``` -DOCKER_BUILDKIT=1 docker build . \ - --build-arg CANDIDATE_NAME=test \ - --file build.Dockerfile \ - --tag gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/build -``` - ## Run Tests We use [container structure tests](https://github.com/GoogleContainerTools/container-structure-test) @@ -67,11 +44,3 @@ container-structure-test test \ --image gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/run \ --config run_structure_test.yaml ``` - -To test the build image: - -``` -container-structure-test test \ - --image gcr.io/gae-runtimes/buildpacks/stacks/google-min-22/build \ - --config build_structure_test.yaml -``` \ No newline at end of file diff --git a/stacks/google_min_22/build-packages.txt b/stacks/google_min_22/build-packages.txt deleted file mode 100644 index dbf190921..000000000 --- a/stacks/google_min_22/build-packages.txt +++ /dev/null @@ -1,11 +0,0 @@ -build-essential -ca-certificates -curl -git -locales -openssl -tar -tzdata -unzip -xz-utils -zip \ No newline at end of file diff --git a/stacks/google_min_22/build.Dockerfile b/stacks/google_min_22/build.Dockerfile deleted file mode 100644 index 18b4bd992..000000000 --- a/stacks/google_min_22/build.Dockerfile +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2022 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. - -FROM marketplace.gcr.io/google/ubuntu2204:latest - -COPY build-packages.txt /tmp/packages.txt - -# Version identifier of the image. -ARG CANDIDATE_NAME -RUN --mount=type=secret,id=pro-attach-config \ - apt-get update -y && \ - # Here we install `pro` (ubuntu-advantage-tools) as well as ca-certificates, - # which is required to talk to the Ubuntu Pro authentication server securely. - apt-get install --no-install-recommends -y ubuntu-advantage-tools ca-certificates && \ - (pro attach --attach-config /run/secrets/pro-attach-config || true) && \ - # Write version information - mkdir -p /usr/local/versions && \ - echo ${CANDIDATE_NAME} > /usr/local/versions/run_base && \ - # Disable universe and multiverse repositories - mv /etc/apt/sources.list /etc/apt/sources.list.universe && \ - cat /etc/apt/sources.list.universe \ - | sed 's/^deb\(.*\(multi\|uni\)verse\)/# deb\1/g' >/etc/apt/sources.list && \ - # Install packages - export DEBIAN_FRONTEND=noninteractive && \ - apt-get update -y && \ - apt-get upgrade -y --no-install-recommends --allow-remove-essential && \ - xargs -a /tmp/packages.txt \ - apt-get -y -qq --no-install-recommends --allow-remove-essential install && \ - apt-get purge --auto-remove -y ubuntu-advantage-tools && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ - rm /tmp/packages.txt && \ - unset DEBIAN_FRONTEND && \ - rm -rf /run/ubuntu-advantage && \ - # Restore universe and multiverse repositories to ease extending our stacks - mv /etc/apt/sources.list.universe /etc/apt/sources.list && \ - # Configure the system locale - locale-gen en_US.UTF-8 && \ - update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 && \ - # Precreate BUILDER_OUTPUT target - mkdir -p /builder/outputs/ && chmod 777 /builder/outputs/ && \ - # Configure the user's home directory - mkdir /www-data-home && \ - chown www-data:www-data /www-data-home && \ - usermod -d /www-data-home www-data - -ARG cnb_uid=33 -ARG cnb_gid=33 -USER ${cnb_uid}:${cnb_gid} - -ENV LANG="en_US.UTF-8" -ENV LANGUAGE="en_US:en" -ENV LC_ALL="en_US.UTF-8" -ENV CNB_STACK_ID="google.gae.22" -ENV CNB_USER_ID=${cnb_uid} -ENV CNB_GROUP_ID=${cnb_gid} - -# Standard buildpacks metadata -LABEL io.buildpacks.stack.id="google.gae.22" -LABEL io.buildpacks.stack.distro.name="Ubuntu" -LABEL io.buildpacks.stack.distro.version="22.04" -LABEL io.buildpacks.stack.maintainer="Google" -LABEL io.buildpacks.stack.mixins="[]" -LABEL io.buildpacks.stack.homepage \ - "https://github.com/GoogleCloudPlatform/buildpacks/stacks/google-min-22" - -# Set $PORT to 8080 by default -ENV PORT 8080 -EXPOSE 8080 \ No newline at end of file diff --git a/stacks/google_min_22/build_structure_test.yaml b/stacks/google_min_22/build_structure_test.yaml deleted file mode 100644 index 4d2874a49..000000000 --- a/stacks/google_min_22/build_structure_test.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2022 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. -# -# Container structure test to validate the google.gae.22 build image. - -schemaVersion: '2.0.0' - -metadataTest: - envVars: - - key: LANG - value: 'en_US.UTF-8' - - key: LANGUAGE - value: 'en_US:en' - - key: LC_ALL - value: 'en_US.UTF-8' - - key: 'CNB_STACK_ID' - value: 'google.gae.22' - - key: 'CNB_USER_ID' - value: '33' - - key: 'CNB_GROUP_ID' - value: '33' - labels: - - key: 'io.buildpacks.stack.id' - value: 'google.gae.22' - - key: 'io.buildpacks.stack.distro.name' - value: 'Ubuntu' - - key: 'io.buildpacks.stack.distro.version' - value: '22.04' - - key: 'io.buildpacks.stack.maintainer' - value: 'Google' - - key: 'io.buildpacks.stack.mixins' - value: '[]' - - key: 'io.buildpacks.stack.homepage' - value: 'https://github.com/GoogleCloudPlatform/buildpacks/stacks/google-min-22' - exposedPorts: [] - user: "33:33" - -fileExistenceTests: -- name: 'home dir' - path: '/www-data-home' - shouldExist: true - permissions: 'drwxr-xr-x' - -commandTests: -- name: 'installed packages' - command: 'apt' - args: ['list', '--installed'] - expectedOutput: [ - 'ca-certificates', - 'locales', - 'openssl', - 'tzdata', - ] \ No newline at end of file diff --git a/tools/cloudbuild/create_stacks.yaml b/tools/cloudbuild/create_stacks.yaml index 16248d509..564f03dfc 100644 --- a/tools/cloudbuild/create_stacks.yaml +++ b/tools/cloudbuild/create_stacks.yaml @@ -20,17 +20,6 @@ # $ gcloud builds submit --config=tools/cloudbuild/create_stacks.yaml \ # --substitutions _CANDIDATE_NAME=my-local-build steps: - - id: min-build-image - name: gcr.io/cloud-builders/docker - dir: stacks/google_min_22 - args: - - 'build' - - '--build-arg="packages=build-packages.txt"' - - '--build-arg="CANDIDATE_NAME=${_CANDIDATE_NAME}"' - - '-t=gcr.io/$PROJECT_ID/stacks/google-min-22/build:latest' - - '.' - waitFor: ['-'] - - id: min-run-image name: gcr.io/cloud-builders/docker dir: stacks/google_min_22 @@ -65,7 +54,6 @@ steps: waitFor: ['-'] images: - - 'gcr.io/$PROJECT_ID/stacks/google-min-22/build:latest' - 'gcr.io/$PROJECT_ID/stacks/google-min-22/run:latest' - 'gcr.io/$PROJECT_ID/stacks/google-gae-22/build:latest' - 'gcr.io/$PROJECT_ID/stacks/google-gae-22/run:latest'