Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
my-docker-tutoriel-jupyter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thiery Nicolas
my-docker-tutoriel-jupyter
Commits
4e38458d
Commit
4e38458d
authored
3 months ago
by
Nicolas M. Thiéry
Browse files
Options
Downloads
Patches
Plain Diff
CI: Update image build to latest best practices (kaniko, ...)
parent
d8f170e0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#54006
passed
3 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+17
-23
17 additions, 23 deletions
.gitlab-ci.yml
Dockerfile-CI
+21
-7
21 additions, 7 deletions
Dockerfile-CI
with
38 additions
and
30 deletions
.gitlab-ci.yml
+
17
−
23
View file @
4e38458d
stages
:
-
build_image
#- test
variables
:
variables
:
DEPENDENCIES_IMAGE_NAME
:
"
${CI_REGISTRY_IMAGE}/image:latest"
IMAGE
:
"
${CI_REGISTRY_IMAGE}/image:latest"
MYDOCKER_IMAGE_NAME
:
"
${CI_REGISTRY_IMAGE}/mydocker-image:latest"
IMAGE_WITH_VERSION
:
"
${CI_REGISTRY_IMAGE}/image:${CI_COMMIT_SHA}"
STORAGE_DRIVER
:
vfs
# for buildah
REGISTRY_AUTH_FILE
:
/root/auth.json
build_image
:
build_image
:
stage
:
build_image
# ref: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html
# image: tomkukral/buildah:0.31
tags
:
before_script
:
-
docker
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
image
:
# - podman login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
name
:
gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint
:
[
"
"
]
script
:
script
:
-
docker build -t ${DEPENDENCIES_IMAGE_NAME} --file Dockerfile-CI .
-
/kaniko/executor
-
docker push ${DEPENDENCIES_IMAGE_NAME}
--context "${CI_PROJECT_DIR}"
# - buildah build-using-dockerfile --format docker -t ${DEPENDENCIES_IMAGE_NAME} --file Dockerfile-CI .
--dockerfile "${CI_PROJECT_DIR}/Dockerfile-CI"
# - buildah push --authfile ${REGISTRY_AUTH_FILE} ${DEPENDENCIES_IMAGE_NAME}
--destination "${IMAGE_WITH_VERSION}"
after_script
:
--destination "${IMAGE}"
-
podman logout "${CI_REGISTRY}"
--cache=true
# only:
--single-snapshot
# changes:
--snapshot-mode=time
# --compressed-caching=false
image
:
${DEPENDENCIES_IMAGE_NAME}
# test:
# test:
# stage: test
# stage: test
...
...
This diff is collapsed.
Click to expand it.
Dockerfile-CI
+
21
−
7
View file @
4e38458d
...
@@ -5,16 +5,30 @@ COPY --chown=$MAMBA_USER:$MAMBA_USER . /tmp/binder
...
@@ -5,16 +5,30 @@ COPY --chown=$MAMBA_USER:$MAMBA_USER . /tmp/binder
# Install conda packages
# Install conda packages
RUN cd /tmp/binder && \
RUN cd /tmp/binder && \
micromamba install -y -n base -f environment.yml && \
micromamba install -y -n base -f environment.yml && \
micromamba clean --all --yes
micromamba clean --all --yes && \
/usr/local/bin/_entrypoint.sh pip cache purge
# Install configuration files
# After installing the packages to make sure these
# take precedence
RUN cp -rav /tmp/binder/install_files/* /opt/conda/
# Install configuration files after installing the packages to make
# sure these take precedence
RUN cp -rav /tmp/binder/install_files/* /opt/conda/
RUN rm -rf /tmp/binder
RUN rm -rf /tmp/binder
# Set up environment
# Set up environment
VOLUME
/home/mambauser
WORKDIR
/home/mambauser
ENV SHELL=/bin/bash
ENV SHELL=/bin/bash
ENV LANG fr_FR.UTF-8
ENV LANG fr_FR.UTF-8
USER root
# Activate the conda environment in the shell
RUN /usr/local/bin/_entrypoint.sh mamba shell activate >> /etc/profile.d/conda.sh
# Install debian packages
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \
less tree \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER $MAMBA_USER
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment