Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Textgrid Repository WebDAV Server
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
Service Desk
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
DARIAH-DE
TextGridRep
Textgrid Repository WebDAV Server
Commits
cba495b6
Commit
cba495b6
authored
3 years ago
by
Stefan Hynek
Browse files
Options
Downloads
Plain Diff
Merge branch '1-prepare-dockerfile-and-ci-for-testing-image-build' into 'main'
Resolve "prepare Dockerfile and CI for testing image build" Closes
#1
See merge request
!1
parents
19036498
a0032db7
No related branches found
No related tags found
1 merge request
!1
Resolve "prepare Dockerfile and CI for testing image build"
Pipeline
#246204
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+50
-0
50 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+30
-2
30 additions, 2 deletions
Dockerfile
with
80 additions
and
2 deletions
.gitlab-ci.yml
0 → 100644
+
50
−
0
View file @
cba495b6
---
workflow
:
rules
:
-
if
:
$CI_MERGE_REQUEST_IID
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-
if
:
$CI_COMMIT_TAG
stages
:
-
test
-
build
lint dockerfile
:
stage
:
test
image
:
hadolint/hadolint:latest-debian
before_script
:
-
mkdir -p reports
script
:
-
hadolint --format gitlab_codeclimate Dockerfile > reports/hadolint-$(md5sum Dockerfile | cut -d" " -f1).json
artifacts
:
name
:
"
$CI_JOB_NAME
artifacts
from
$CI_PROJECT_NAME
on
$CI_COMMIT_REF_SLUG"
when
:
always
reports
:
codequality
:
-
"
reports/*"
paths
:
-
"
reports/*"
rules
:
-
if
:
$CI_MERGE_REQUEST_IID
changes
:
-
Dockerfile
build container image
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64 | tr -d '\n')\"},\"$harbor_registry\":{\"auth\":\"$HARBOR_ROBOT_TOKEN64\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg vcs_ref=${CI_COMMIT_SHORT_SHA}
--build-arg version=${CI_COMMIT_SHORT_SHA}
--destination $CI_REGISTRY_IMAGE/repdav:$CI_COMMIT_SHORT_SHA
--destination $harbor_registry/$harbor_repo/repdav:$CI_COMMIT_SHORT_SHA
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
This diff is collapsed.
Click to expand it.
Dockerfile
+
30
−
2
View file @
cba495b6
# syntax=docker/dockerfile:1
FROM
python:3.8
LABEL
\
org.label-schema.dockerfile="/Dockerfile" \
org.label-schema.license="AGPL-3.0-or-later" \
org.label-schema.maintainer="Stefan Hynek" \
org.label-schema.name="Textgrid Repository WebDAV Server" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://gitlab.gwdg.de/dariah-de/textgridrep/repdav" \
org.label-schema.vcs-url="https://gitlab.gwdg.de/dariah-de/textgridrep/repdav" \
org.label-schema.vendor="SUB/FE"
RUN
useradd
--create-home
repdav
USER
repdav
COPY
--chown=repdav requirements.txt /
RUN
pip
install
\
--no-cache-dir
\
--requirement
requirements.txt
\
--user
WORKDIR
/app
COPY
--chown=repdav src/ .
COPY
requirements.txt .
RUN
pip
install
-r
requirements.txt
ARG
build_date
ARG
vcs_ref
ARG
version
LABEL
\
org.label-schema.build-date="${build_date}" \
org.label-schema.vcs-ref="${vcs_ref}" \
org.label-schema.version="${version}"
CMD
["python", "main.py"]
COPY
Dockerfile /
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