Skip to content
Snippets Groups Projects
Commit e19d61c0 authored by Quang tru HUYNH's avatar Quang tru HUYNH
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #79497 failed
stages:
- step1
- step2
docker-build-push:
stage: step1
image:
name: registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:latest
services:
- registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
script:
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry-gitlab.pasteur.fr
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME" .
- docker push "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME"
- docker tag "$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
- export MY_TIME=`date +"%F-%H%M"`
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:$MY_TIME"
- docker push "$CI_REGISTRY_IMAGE:$MY_TIME"
singularity-build-push:
stage: step2
needs: ["docker-build-push"]
image:
name: quay.io/singularity/singularity:v3.8.4
entrypoint: [""]
script:
- singularity build singularity.sif Singularity
- singularity push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" singularity.sif oras://"$CI_REGISTRY_IMAGE":"latest"
FROM mathworks/matlab:r2022a
MAINTAINER Tru Huynh <tru@pasteur.fr>
RUN date +"%Y-%m-%d-%H%M" > /last_update
This diff is collapsed.
# building a matlab R2022a toy system for singularity and docker image for CI
Tru <tru@pasteur.fr>
## Why ?
- toy system for gitlab-CI
- build docker image from dockerhub registry and push to registry.pasteur.fr with proper tags
- build docker image, push to registry.pasteur.fr and re-use that docker image to create a singularity container as artefact
- keeping an onsite version of https://hub.docker.com/r/mathworks/matlab
## Caveat
- playground, use at your own risk!
- `:main` tagged docker image
- `:latest` tagged singularity image
## Usage:
Docker: cf https://hub.docker.com/r/mathworks/matlab
```
docker run -e MLM_LICENSE_FILE=27000@MyLicenseServer -ti registry-gitlab.pasteur.fr/tru/singularity-docker-matlab-r2022a:main
```
Singularity:
```
singularity run --env MLM_LICENSE_FILE=27000@MyLicenseServer oras://registry-gitlab.pasteur.fr/tru/singularity-docker-matlab-r2022a:latest
```
BootStrap: docker
From: registry-gitlab.pasteur.fr/tru/singularity-docker-matlab-r2022a:main
%post
date +"%Y-%m-%d-%H%M" > /last_update
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment