Skip to content
Snippets Groups Projects
Commit a11a987b authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

use cache in my-r-base

parent c8e617a5
No related branches found
No related tags found
1 merge request!9Draft: split build in multiple stage
Pipeline #102180 failed
......@@ -43,11 +43,16 @@ build-my-r-base:
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# pull the previous stage
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:$CI_COMMIT_SHA"
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:latest"
# pull the latest build of the target R version in order to re-use it
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$R_VERSION" || true
# pull the latest build of the target R version in order to re-use it
- docker pull "$CI_REGISTRY_IMAGE:$R_VERSION" || true
# building
- docker build
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/my-base:latest"
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$R_VERSION"
--cache-from "$CI_REGISTRY_IMAGE:$R_VERSION"
--build-arg R_VERSION
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/${STAGE_NAME}/${R_VERSION}:$CI_COMMIT_SHA"
--file Dockerfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment