Sign inSign up

bmeme/gcp-image-builder

By bmeme

•Updated 11 months ago

Bmeme OCI Image to build and push container on GCP platform

Image
0

3.1K

bmeme/gcp-image-builder repository overview

Maintenance MIT license

⁠GCP IMAGE BUILDER

OCI image, based on the official Docker image⁠ and integrated with Google Cloud SDK⁠ and Kaniko Executor⁠, currently being used in Bmeme for Continuous Integration and Delivery.

⁠What is contained in the images

  • Google Cloud SDK
  • Docker
  • Kaniko
  • build-base tools
  • python 3.11
  • git
  • docker-compose (for backward compatibility)
  • A script authenticate that wraps authentication tasks against Google Cloud and Google Artifact Registry

⁠Mandatory environments

Variable NameDescription
GCP_SERVICE_ACCOUNTThe json key of the Google Service Account granted
GCP_REGISTRY_HOSTYour Google Cloud Artifact Registry host

⁠Scripts

⁠Authentication

Set mandatory enviroments, then:

# /usr/bin/authenticate

⁠How to use it in a .gitlab-ci.yml pipeline

image: bmeme/gcp-image-builder:latest

stages:
  - build
  - package

variables:
  GCP_PROJECT_ID: my-gcp-project
  GCP_REGISTRY_HOST: europe-docker.pkg.dev #for example

before_script:
  - /usr/bin/authenticate

build:
  stage: build
  script:
    - docker compose up -d

package:
  stage: package
  script:
    - |
      kaniko/executor \
        --dockerfile=/path/to/my/Dockerfile \
        --destination=${GCP_REGISTRY_HOST}/${GCP_PROJECT_ID}/my-repo-name/my-image:1.0.0 \
        --destination=${GCP_REGISTRY_HOST}/${GCP_PROJECT_ID}/my-repo-name/my-image:latest \
        --cache=true \
        --cache-repo=${GCP_REGISTRY_HOST}/${GCP_PROJECT_ID}/my-repo-name/my-image/cache

Tag summary

Content type

Image

Digest

sha256:a556b70e4…

Size

502.3 MB

Last updated

11 months ago

docker pull bmeme/gcp-image-builder