Im moving away from docker dind builds now by transition to gitlab kubernetes executor. We are investigating if i could use Kaniko for this process. Is the correct strategy to extend the kaniko image with git and then clone in the script like below or is there any better way in these scenarios
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- <install-git>
- <perform-clone>
- <perform-clone>
- <perform-clone>
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
rules:
- if: $CI_COMMIT_TAG
https://docs.gitlab.com/ee/ci/docker/using_kaniko.html
The issue is that we have the https://github.com/bitnami/containers/blob/main/bitnami/odoo/16/debian-11/Dockerfile
And we want to extend this by the community addions git libs
- git clone -b 16.0 https://github.com/OCA/web.git ${ODOO_INSTALL_DIR}/odoo16-oca-web
- git clone -b 16.0 https://github.com/OCA/server-tools.git ${ODOO_INSTALL_DIR}/odoo16-oca-server-tools
- git clone -b 16.0 https://github.com/OCA/connector.git ${ODOO_INSTALL_DIR}/odoo16-oca-connector
And add them in the multistage build by a custom Dockerfile
FROM bitnami/odoo:16
ARG odoo_dir=/app/odoo
# Since we include multiple repos it is not possible to have a build context, making it not possible
# To work with Dockerignore
ADD odoo16-oca-connector ${odoo_dir}/odoo16-oca-connector
ADD odoo16-oca-server-tools ${odoo_dir}/odoo16-oca-server-tools
ADD odoo16-oca-web ${odoo_dir}/odoo16-oca-web
USER root
ENTRYPOINT [ "/opt/bitnami/scripts/odoo/entrypoint.sh" ]
CMD [ "/opt/bitnami/scripts/odoo/run.sh" ]
Alternative solutions or advices getting forward.