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: ...@@ -43,11 +43,16 @@ build-my-r-base:
script: script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# pull the previous stage # 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 # 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 - 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 # building
- docker build - 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 --build-arg R_VERSION
--tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/${STAGE_NAME}/${R_VERSION}:$CI_COMMIT_SHA" --tag "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/${STAGE_NAME}/${R_VERSION}:$CI_COMMIT_SHA"
--file Dockerfile --file Dockerfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment