use kaniko to build container

This commit is contained in:
Sebastian Hugentobler 2022-02-14 06:31:32 +01:00
parent 120e272b7d
commit ec32df84cd
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
6 changed files with 16 additions and 19 deletions

View File

@ -1,9 +0,0 @@
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

View File

@ -1,18 +1,22 @@
stages: stages:
- build - build
- trigger
variables: variables:
IMAGE_NAME: thallian/php8-fpm CI_REGISTRY_IMAGE: thallian/php8-fpm
CI_BUILD_ARCHS: "linux/amd64,linux/arm64" DOWNSTREAM_PROJECTS: ""
DOWNSTREAM_PROJECTS: "49 51"
build: build:
stage: build stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script: script:
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - mkdir -p /kaniko/.docker
- docker buildx build --platform "$CI_BUILD_ARCHS" --progress plain --pull --tag "$IMAGE_NAME:$CI_COMMIT_SHA" --tag "$IMAGE_NAME:$CI_COMMIT_REF_NAME" --tag "$IMAGE_NAME:latest" --push . - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- | - >-
for proj in $DOWNSTREAM_PROJECTS; do /kaniko/executor
curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master $CI_API_V4_URL/projects/$proj/trigger/pipeline --context "$CI_PROJECT_DIR"
done --dockerfile "$CI_PROJECT_DIR/Dockerfile"
--destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
--destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
--destination "$CI_REGISTRY_IMAGE:latest"

View File

@ -0,0 +1 @@
confd

View File

@ -0,0 +1 @@
longrun