Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
79306f1b
Commit
79306f1b
authored
1 year ago
by
Manon Blanco
Committed by
Yoann Schneider
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Publish a docker image in CI
parent
7209ccea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!267
Publish a docker image in CI
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+15
-0
15 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+14
-0
14 additions, 0 deletions
Dockerfile
MANIFEST.in
+1
-0
1 addition, 0 deletions
MANIFEST.in
ci/build.sh
+32
-0
32 additions, 0 deletions
ci/build.sh
with
62 additions
and
0 deletions
.gitlab-ci.yml
+
15
−
0
View file @
79306f1b
...
...
@@ -52,6 +52,21 @@ test:
script
:
-
tox -- -v
docker-build
:
stage
:
build
image
:
docker:19.03.1
services
:
-
docker:dind
variables
:
DOCKER_DRIVER
:
overlay2
DOCKER_HOST
:
tcp://docker:2375/
except
:
-
schedules
script
:
-
ci/build.sh
# Make sure docs still build correctly
.docs
:
image
:
python:3.10
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
14
−
0
View file @
79306f1b
FROM
nvidia/cuda:12.2.0-base-ubuntu22.04
# Install python and pip
RUN
apt-get
-y
update
&&
\
apt-get
-y
install
python3 python3-pip
&&
\
apt-get clean
-y
WORKDIR
/src
# Install DAN as a package
COPY
dan dan
COPY
teklia_line_image_extractor teklia_line_image_extractor
COPY
requirements.txt *-requirements.txt setup.py VERSION README.md ./
RUN
pip
install
.
--no-cache-dir
This diff is collapsed.
Click to expand it.
MANIFEST.in
+
1
−
0
View file @
79306f1b
...
...
@@ -2,3 +2,4 @@ include requirements.txt
include doc-requirements.txt
include mlflow-requirements.txt
include VERSION
include README.md
This diff is collapsed.
Click to expand it.
ci/build.sh
0 → 100755
+
32
−
0
View file @
79306f1b
#!/bin/sh -e
# Build the tasks Docker image.
# Requires CI_PROJECT_DIR and CI_REGISTRY_IMAGE to be set.
# VERSION defaults to latest.
# Will automatically login to a registry if CI_REGISTRY, CI_REGISTRY_USER and CI_REGISTRY_PASSWORD are set.
# Will only push an image if $CI_REGISTRY is set.
if
[
-z
"
$VERSION
"
]
;
then
VERSION
=
${
CI_COMMIT_TAG
:-
latest
}
fi
if
[
-z
"
$VERSION
"
-o
-z
"
$CI_PROJECT_DIR
"
-o
-z
"
$CI_REGISTRY_IMAGE
"
]
;
then
echo
Missing environment variables
exit
1
fi
IMAGE_TAG
=
"
$CI_REGISTRY_IMAGE
:
$VERSION
"
cd
$CI_PROJECT_DIR
docker build
-f
Dockerfile
.
-t
"
$IMAGE_TAG
"
# Publish the image on the main branch or on a tag
if
[
"
$CI_COMMIT_REF_NAME
"
=
"main"
-o
-n
"
$CI_COMMIT_TAG
"
]
;
then
if
[
-n
"
$CI_REGISTRY
"
-a
-n
"
$CI_REGISTRY_USER
"
-a
-n
"
$CI_REGISTRY_PASSWORD
"
]
;
then
echo
$CI_REGISTRY_PASSWORD
| docker login
-u
$CI_REGISTRY_USER
--password-stdin
$CI_REGISTRY
docker push
$IMAGE_TAG
else
echo
"Missing environment variables to log in to the container registry…"
fi
else
echo
"The build was not published to the repository registry (only for main branch or tags)…"
fi
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